URGENT 100 points!! Problems with Named pipes

Source: Internet
Author: User
Tags posix
Named pipes, read and write reader.php and writer.php (code see below).
Now I need to execute writer.php through the browser to write the data to the pipe and execute reader.php in the shell to read the data.
The problem is prompt write success, but no data is read.
The PHP documentation indicates that the UID is checked in safe mode, but is set to the same (both 48), (the document shows that Safe mode has been removed from PHP 5.4.0). If both read and write through the browser or the shell is able to read and write success.
Excuse me, what's going on here? How do I fix it? Thank you!

Operating system: CentOS 7.0 64-bit
php:5.6.0

reader.php
 
  


writer.php
 
  \ n "; $ret = fwrite ($f, $msg); echo" Write pipe: ". $ret."
\ n "; fclose ($f);//posix_setuid; echo" User: ". Get_current_user ()."
\ n "; echo" POSIX uid: ". Posix_getuid ()."
\ n "; echo" my uid: ". Getmyuid ()."
\ n "; Echo $msg;? >


Reply to discussion (solution)

$mode = 0600;? It should be wrong.
Should be at least 0644

I use the same user to perform reader.php and writer.php separately

The results of the execution were successful.

$mode = 0600;? It should be wrong.
Should be at least 0644



Zuning teacher has been in the forum very active, why so much time ah, you do what work?

Web-like PHP and the shell of PHP, how can it be a user?

Retired, unemployed at home.

$mode = 0600;? It should be wrong.
Should be at least 0644


0666 also tried, not all.
Use Get_current_user and Posix_getuid to get the user and UID are all the same ah, odd strange

I use the same user to perform reader.php and writer.php separately

The results of the execution were successful.



The execution scene is like me?

Dizzy ~ ~ ~

Environment 1:
Operating system: CentOS 7.0
php:5.6.0
apache:2.4.6

Environment 2:
Operating system: Ubuntu 13.10
php:5.5.3
apache:2.4.6

"Environment 1" read and write Failed, "Environment 2" read and write success!!!!!!
Can someone help me with this? My actual operating environment is "Environment 1".

Dizzy ~ ~ ~

Environment 1:
Operating system: CentOS 7.0
php:5.6.0
apache:2.4.6

Environment 2:
Operating system: Ubuntu 13.10
php:5.5.3
apache:2.4.6

"Environment 1" read and write Failed, "Environment 2" read and write success!!!!!!
Can someone help me with this? My actual operating environment is "Environment 1".


Check out the/VAR/LOG/SECURITY,RH series generally, SELinux permissions are not resolved


Dizzy ~ ~ ~

Environment 1:
Operating system: CentOS 7.0
php:5.6.0
apache:2.4.6

Environment 2:
Operating system: Ubuntu 13.10
php:5.5.3
apache:2.4.6

"Environment 1" read and write Failed, "Environment 2" read and write success!!!!!!
Can someone help me with this? My actual operating environment is "Environment 1".


Check out the/VAR/LOG/SECURITY,RH series generally, SELinux permissions are not resolved



SELinux is not enabled and has been turned off. This thing on the PHP effect is very big, before a what problem I checked for a long, then simply completely shut down.

Open Display_errors, while looking at the system/php/apache/security class log, failure will always leave a log, this nameless error log is the best breakthrough

?? What's the limit??, you want to take a test???? The use of the case is the same as the Apache, as long as the limit?? And in the same? Is??? Of
If you can't find a??? ?, you change the error?? Wait, catch???. Let's see.

?? What's the limit??, you want to take a test???? The use of the case is the same as the Apache, as long as the limit?? And in the same? Is??? Of
If you can't find a??? ?, you change the error?? Wait, catch???. Let's see.


Permissions in the code has been set Ah, the log is all open, and no hint. It's a question of CentOS, but I don't know where it is.

Operating system reasons, under CENTOS7 must all be Web-enabled, you can launch a Web request with curl under the shell to enable the other end of the pipeline

  • 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.