0

I have a simple apache2 server set up on my raspberry pi to run a local website at home.

I'd like to be able to use PHP to read the contents of other folders on the Raspberry Pi, outside of the specified wwwroot.

I actually keep my wwwroot in my samba drive on the raspberry pi, located in:

/network-drive/website

I'd like to be able to access other folders in the /network-drive directory using PHP scripts inside the website folder.

Is this possible? I tried disabling open_basedir in php.ini, but that didn't change anything!

1 Answer 1

1

Works fine on my default LAMP setup on raspbian. DocumentRoot is default /var/www/html, permissions on /storage is 755 and /storage/test is 644

<?php

$fh=fopen("/storage/test",r);
$line=fgets($fh);
fclose($fh);
echo $line;

?>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .