Linux under the name pipe operation permissions on the issue of the resolution of the small note

Source: Internet
Author: User
Tags php script

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 ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.