Accessing pictures outside of www with php
Hello,
I'm running apache and using php to deliver a page. I am using a function to randomly serve a picture through a php page (/var/www/html/pf) when called as such: PHP Code:
But now I want to replace the folder 'apa' with a symlink to a folder outside of www, more specifically /shares/bilder/Wille I have tried reading up on it and messed around with <Directory> ans <Alias> tags in the Apache config, I've added a symlink to the /shares/bilder/Wille folder, I've set access rights on both symlink and the real folder/files but nothing works. The glob returns an empty array whatever I do. I'm assuming I'm simply not able to set it up correctly with the correct configuration of all the above. So.. I'm hoping someone where can give me instructions on how to get it to work. Thanks in advance! |
You have to tell the PHP interpreter that it has access to that folder by changing the open_basedir setting in your php.ini.
|
Thanks for the suggestion TobiSGD. But adding entries there only mean I block php execution in all other places and did not help me. IT could come in handy some other time though so not wasted information!
For everyone else -I'm closing this thread since I got it working. I can't say I know exactly how but a combination of the correct <Directory> tags in apache config, removing a broken .htaccess file (thansk to /var/log/apache2/error.log and mostl likely some more access right configurations. Clsoing thread. |
All times are GMT -5. The time now is 02:03 PM. |