PHP and CGI Broken pipe on Linux

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
lancz
-


Joined: 18 Nov 2005
Posts: 2

PostPosted: Fri Nov 18, 2005 1:35 am    Post subject: PHP and CGI Broken pipe on Linux Reply with quote

Hallo all. I was look around but I can made it my self. I need yours help with my problem. I have on my machine Linux system and apache server with php mysql and Zend and PHP working fine. But I need another web server so I was using abyss without PHP. But now I need have on it PHP support.
I download Abyss Web Server X1 install and run it. Html pages are working fine, next I go to page http://www.aprelium.com/abyssws/php.html#linux
and I do everything like it's write over there.
Next I create sample php file name: my.php

------------------------------------------
cat /www/my.php
<html>
<head>
<title>Example</title>
</head>
<body>
<?php echo "Hi, I'm a PHP script!"; ?>
</body>
</html>
------------------------------------------

and I try php but it's not working.

Only what its hapening that is Error 500 and cgi.log:
------------------------------------------
cat /log/abyss/cgi.log
CGI: [/usr/local/bin/php ] URI: /my.php Broken pipe
CGI: [/usr/local/bin/php ] URI: /my.php Broken pipe
CGI: [/usr/local/bin/php ] URI: /my.php Broken pipe
CGI: [/usr/local/bin/php ] URI: /my.php Broken pipe

------------------------------------------

Can somebody help me please. I find fiew solution but all was for windows or was not working for me, what can I do more?

I instal apache2, php4 , mysql from sources not from rpm
which php gives me
/usr/local/bin/php

I have no idea where its a problem. If somebody need mor info pleas write what kind? I'm waiting. Thnx for reply all.
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Nov 18, 2005 11:09 am    Post subject: Re: PHP and CGI Broken pipe on Linux Reply with quote

lancz,

First of all, check if the my.php file has the executable (x) bit set or not. To remove it, run:

Code:
chmod -x *.php


Is there a php-cgi file in your system (use the locate or which commands)? If it is there, use it as the interpreter in your setup instead of php.

If this does not help, please try executing at the command line:

Code:
/usr/local/bin/php my.php


What is the output you get?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
lancz
-


Joined: 18 Nov 2005
Posts: 2

PostPosted: Fri Nov 18, 2005 12:24 pm    Post subject: Reply with quote

Thnx for reply!

1. I have allready executable permision for file my.php but I put one more time comand:

chmod u+x ./my.php

Its not working still.

2. Command:
which php-cgi
tell me there it's no this file (i find it in php 5), i have php 4 so i use as interpreter file /usr/local/bin/php

Command in shell:
/usr/local/bin/php ./my.php

Give me:

<html>
<head>
<title>Example</title>
</head>
<body>
Hi, I'm a PHP script! </body>
</html>

But its not error i change my file my.php to (i remove html tags):

------------------------------------------
cat /www/my.php

<?php
echo "Hi, I'm a PHP script!";
?>
------------------------------------------

Now when I put a command in shell:

/usr/local/bin/php ./my.php

I have anser:
Hi, I'm a PHP script!

So my PHP it's working...

What can I do more to find solution please help me Thnx I'm waiting for reply ;)
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Nov 19, 2005 1:26 pm    Post subject: Reply with quote

lancz wrote:
Thnx for reply!

1. I have allready executable permision for file my.php but I put one more time comand:

chmod u+x ./my.php

Its not working still.


The x bit should not be set (chmod -x). See our previous post.

Quote:

Command in shell:
/usr/local/bin/php ./my.php

Give me:

<html>
<head>
<title>Example</title>
</head>
<body>
Hi, I'm a PHP script! </body>
</html>

But its not error i change my file my.php to (i remove html tags):

------------------------------------------
cat /www/my.php

<?php
echo "Hi, I'm a PHP script!";
?>
------------------------------------------

Now when I put a command in shell:

/usr/local/bin/php ./my.php

I have anser:
Hi, I'm a PHP script!

So my PHP it's working...

What can I do more to find solution please help me Thnx I'm waiting for reply ;)

Unfortunately, this is not working. This php executable you have is the CLI (commad line interface) PHP version. It isn't the PHP CGI one.
If it was the PHP CGI one, it should have output something like:

Code:
Content-Type: text/html
X-Powered-by: PHP/4.x.x

<html>
    <head>
        <title>Example</title>
    </head>
    <body>
        Hi, I'm a PHP script!    </body>
</html>


Web servers expect the header lines to be in conformance with the CGI protocol.

So we recommend downloading the PHP source code from php.net and building your own CGI executable. Refer to their INSTALL file there to know how to build it (it's usually a 3 or 4 command line sequence on most systems).
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group