I've had a little problem in the last two days. Is Linux under the PHP program and other programs to communicate.
We need to implement the user on the Web page to operate when we can enable our server-side background programs (in C, C + + written).
Previously, under Windows, you have already used named pipe implementations (see my previous blog http://blog.csdn.net/rcfalcon/archive/2010/02/09/5303142.aspx), this time moving the entire server to Linux.
Server Environment CentOS 5 + apache + mysql + php
And then basically follow the previous code framework, quickly on the server side of the communication. (But I was using the root user to run the PHP script test directly)
But later when the test was accessed through the web, the hint said that the permissions for the named pipe could not be taken.
So we start to solve this problem ...
Modify PHP.ini open_basedir settings, no fruit.
Modify several settings of the httpd.conf, not fruit.
Name Pipe chmod 777, no fruit.
Set the Apache server user group to root.
Then the named pipe Pipe chown apache:root, not fruit.
Try PHP to read and write normal files, no problem.
Turn to the official PHP manual, no problem found.
And I'm starting to freak out.
Baidu, Google have turned over more than 10 pages, can not find the correct answer ...
Finally began to turn to the Foreign programming Forum, finally saw a person with me similar situation. But he said he changed the httpd and then restart the service, and tried, and failed.
Finally saw someone said may be the selinux problem, I in the collapse with the last glimmer of hope to ban SELinux, and then restart.
The first is that everything is normal,
And gnome actually made a bunch of mistakes, no matter, go on.
And then......
I can't believe it.
The Evil SELinux ...
The original centos5, RHEL, fedora, such as the default installation SELinux, to a large extent, to enhance the security of the entire Linux system. But a lot of user rights are restricted, for example, in my question, it is to shut down the Apache user's named pipes read and Write permissions.
It seems that the need for a bad supplement Linux Ah, too much food ~