note 56551 added to function.fopen
| From: | durwood at speakeasy dot NOSPAM dot net | Date: | Wed, 07 Sep 2005 06:43:48 +0000 |
| Subject: | note 56551 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94841@lists.php.net to get a copy of this message | ||
I couldn't for the life of me get a certain php script working when i moved my server to a new
Fedora 4 installation. The problem was that fopen() was failing when trying to access a file as a
URL through apache -- even though it worked fine when run from the shell and even though the file
was readily readable from any browser. After trying to place blame on Apache, RedHat, and even my
cat and dog, I finally ran across this bug report on Redhat's website:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=164700
Basically the problem was SELinux (which I knew nothing about) -- you have to run the following
command in order for SELinux to allow php to open a web file:
/usr/sbin/setsebool httpd_can_network_connect=1
To make the change permanent, run it with the -P option:
/usr/sbin/setsebool -P httpd_can_network_connect=1
Hope this helps others out -- it sure took me a long time to track down the problem.
----
Manual Page -- http://www.php.net/manual/en/function.fopen.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56551
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56551&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56551&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56551&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56551&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56551&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56551&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56551&report=yes
Search -- http://master.php.net/manage/user-notes.php