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

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;

?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.