Browser can't see "php-cgi" file to select it as i

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
Suscriptor
-


Joined: 07 Jul 2009
Posts: 8

PostPosted: Thu Jul 16, 2009 3:57 am    Post subject: Browser can't see "php-cgi" file to select it as i Reply with quote

Hi everyone, I've been dealing with this "problem?" for 2 days and I think I need somebody else's help.

In short: I'm trying to enable PHP interpreter using the Abyss Console web interface, but when I use the "Browse..." button to [select] the file it just doesn't show on the list, so I can't select it, I can see other files and go directories down/up, but php, php-cgi, php5 files just don't appear.

My system:

OS: Kubuntu 8.04.2 Desktop LTS (Hardy Heron)
kernel: Linux 2.6.24-23-generic #1 SMP Wed Apr 1 21:47:28 UTC 2009
PHP: PHP 5.2.4
Abyss Web Server: X1 (2.6)

This is what I have done and tried:

1.- I have successfully installed Abyss Web Server in /home/sistemas/bin/abyssws/ . The whole directory belongs to my user and group. I also have sudo privileges:

Code:

$ ls /home/sistemas/bin/abyssws/
total 1.2M
-rwxr-xr-x 1 sistemas sistemas 1.1M 2007-09-05 10:55 abyssws*
-rwxr-xr-x 1 sistemas sistemas 4.0K 2007-09-05 10:55 autostart-setup*
drwxr-xr-x 2 sistemas sistemas 4.0K 2007-09-05 10:55 console/
drwxr-xr-x 2 sistemas sistemas 4.0K 2007-09-05 10:55 doc/
drwxr-xr-x 2 sistemas sistemas 4.0K 2009-07-14 16:18 htdocs/
-rw-r--r-- 1 sistemas sistemas  582 2007-09-05 10:55 Installation Instructions.html
drwxr-xr-x 2 sistemas sistemas 4.0K 2007-09-05 10:55 kcstore/
drwxr-xr-x 2 sistemas sistemas 4.0K 2009-07-14 14:29 lang/
-rw-r--r-- 1 sistemas sistemas 8.2K 2007-09-05 10:55 license.txt
drwxr-xr-x 2 sistemas sistemas 4.0K 2009-02-24 18:20 log/
-rw------- 1 sistemas sistemas  767 2009-07-15 13:09 persist.data


Then I modified the htdocs/index.html file just adding a link to a phpinfo.php file:

Code:

<a href="/phpinfo.php">PHP info</a>


the content of it is just:

Code:

<?php
phpinfo();
?>


2.- I have successfully ran the abyssws command for the first time to only create the abyssws.conf file then I hit CTRL+C to stop it, and took notes of the ports opened which were 8000 and 9999

Code:

$ ./abyssws --start
Abyss Web Server X1 (v 2.6)
Copyright (C) Aprelium - 2001-2009

-- Default host on port 8000 is up and running (Local URL http://127.0.0.1:8000)

Console local URL: http://127.0.0.1:9999

Signal #2 received. Shutting down the server...


the abyssws.conf file was created OK:

Code:

$ ls -lh abyss.conf
-rw------- 1 sistemas sistemas 12K 2009-07-15 15:53 abyss.conf


3.- I have successfully installed the autostart feature using root privileges with the sudo command:

Code:

$ sudo ./autostart-setup install
[sudo] password for sistemas: *****
[: 167: Illegal number:
 Adding system startup for /etc/init.d/abyssws ...
   /etc/rc0.d/K99abyssws -> ../init.d/abyssws
   /etc/rc1.d/K99abyssws -> ../init.d/abyssws
   /etc/rc6.d/K99abyssws -> ../init.d/abyssws
   /etc/rc2.d/S99abyssws -> ../init.d/abyssws
   /etc/rc3.d/S99abyssws -> ../init.d/abyssws
   /etc/rc4.d/S99abyssws -> ../init.d/abyssws
   /etc/rc5.d/S99abyssws -> ../init.d/abyssws


despite the "167 error" it works.

4.- I have successfully installed php-cgi from the official repositories in Kubuntu. I have not mixed repositories from other versions:

Code:

$ which php
/usr/bin/php

$ ls /usr/bin/php*
lrwxrwxrwx 1 root root   21 2009-07-13 19:06 /usr/bin/php -> /etc/alternatives/php*
-rwxr-xr-x 1 root root 5.1M 2009-04-17 09:37 /usr/bin/php5*
-rwxr-xr-x 1 root root 5.0M 2009-04-17 09:37 /usr/bin/php5-cgi*
lrwxrwxrwx 1 root root   25 2009-07-15 14:11 /usr/bin/php-cgi -> /etc/alternatives/php-cgi*

$ php -v
PHP 5.2.4-2ubuntu5.6 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 17 2009 14:31:37)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies


5.- I have successfully initiated the web server and is listening:

Code:

$ /etc/init.d/abyssws start
Starting Abyss Web Server daemon...

$ sudo netstat -l -n -p | grep abyssws
[sudo] password for sistemas:
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      20773/abyssws
tcp        0      0 0.0.0.0:9999            0.0.0.0:*               LISTEN      20773/abyssws


6.- I have successfully browsed to the default page at http://localhost:8000/, and I also have logged in to http://localhost:9999/

Here comes the problem:

I go through "Configure Host", "Scripting Parameters", "Enable Script Execution", "Add Interpreter", "FastCGI (Local - Pipes)", "Browse...", then I navigate to /usr/bin/ but I just can't select any php file because they just don't appear on the list ..... I see many other files but no one related to php. So I have to go back and write the full path to the interpreter, and I have tried all these:

/usr/bin/php
/usr/bin/php-cgi
/usr/bin/php5
/usr/bin/php5-cgi
/etc/alternatives/php

none of them worked. I also tried looking inside these directories as they are in the $PATH environment variable:

Code:

$ echo $PATH
/home/sistemas/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games


I also marked the [] box to add extensions, and added the associated extensions (php) and the virtual path is set to "/*.php". I also went to "Index files" and added "index.php" to be looked for along with "index.html" and "index.htm". Finally I restarted the web server using the "Restart button".

Abyss restarts OK but when I go to http://localhost:8000/ and click on the link to the phpinfo.php file the status bar of the web browser just keeps showing "waiting for localhost ..." and I have to hit Esc and go back, so I can see Abyss hasn't crashed.

I read that sometimes "FastCGI (Local - Pipes)" has to be changed to "CGI/ISAPI" or "PHP Style" to "Standard" and here's what happens when trying several combinations:

CGI/ISAPI + Standard:
restarts by itself? YES
localhost shows "Error 500 Internal Server Error" when clicking on the link that redirects to phpinfo.php

CGI/ISAPI + PHP Style:
restarts by itself? NO, I had to kill and restart
then localhost shows "Error 500 Internal Server Error" when clicking on the link that redirects to phpinfo.php

FastCGI (Local - Pipes) + Standard:
restarts by itself? YES
then localhost shows "Waiting for localhost ..." when clicking on the link that redirects to phpinfo.php

FastCGI (Local - Pipes) + PHP Style:
restarts by itself? NO, I had to kill and restart
then localhost shows "Waiting for localhost ..." when clicking on the link that redirects to phpinfo.php

Every time I had to kill Abyss:

This didn't work:

Code:

$ sudo /etc/init.d/abyssws stop
Stopping Abyss Web Server daemon...
$


because .....

Code:

$ sudo netstat -l -n -p | grep abyssws
[sudo] password for sistemas:
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      7603/abyssws
tcp        0      0 0.0.0.0:9999            0.0.0.0:*               LISTEN      7603/abyssws
unix  2      [ ACC ]     STREAM     LISTENING     106910   7603/abyssws        /tmp/abws-fcgi-00000000-00000b3300004268
$


that made me go to:

Code:

$ ls /tmp/ab*
srw------- 1 sistemas sistemas 0 2009-07-15 11:31 /tmp/abws-fcgi-00000000-00000b3300004268=
srw------- 1 sistemas root     0 2009-07-14 18:21 /tmp/abws-fcgi-00000000-00001597003d6e90=
srw------- 1 sistemas sistemas 0 2009-07-15 13:40 /tmp/abws-fcgi-00000000-000019670000e678=
srw------- 1 sistemas sistemas 0 2009-07-15 13:42 /tmp/abws-fcgi-00000000-00001b2300005208=


so I had to send SIGKILL (-9) because SIGTERM (-15) didn't work on these processes:

Code:

~/bin/abyssws/abyssws -d
+ ~/bin/abyssws/abyssws --slave --interactive -d
+ ~/bin/abyssws/abyssws --slave --interactive -d
+ ~/bin/abyssws/abyssws --slave --interactive -d


After killing Abyss I restarted it as usual and then I went to try the every configuration recently applied.

I hope not to bother with this long post, I just wanted to be sure to show you all what I have tried. I also read several other posts here in the forum (about 8 or 10), using PHP keyword in the search box, but none of the solutions offered on them has worked for me.

Thank you all for taking the time to read this, and for your kind guidance.

Suscriptor,
in MEXICO.
Back to top View user's profile Send private message
DonQuichote
-


Joined: 24 Dec 2006
Posts: 68
Location: The Netherlands

PostPosted: Thu Jul 16, 2009 10:29 am    Post subject: My config Reply with quote

I cannot see anything wrong with what you did. The abyss runs fine on my Xubuntu systems. You mention that the config flie is generated. If you open that file (back it up first), and look under
//root/server/host/ , you see an element called "scripting". For my system, it reads:
Code:
         <scripting>
            <enabled>
               yes
            </enabled>
            <cgi>
               <timeout>
                  30
               </timeout>
               <useregistry>
                  no
               </useregistry>
               <useshebang>
                  yes
               </useshebang>
               <errorfile>
                  /var/log/abyssws/cgi.log
               </errorfile>
            </cgi>
            <isapi>
               <ext>
                  dll
               </ext>
               <errorfile>
                  /var/log/abyssws/isapi.log
               </errorfile>
               <debuglevel>
                  1
               </debuglevel>
            </isapi>
            <fastcgi>
               <errorfile>
                  /var/log/abyssws/fastcgi.log
               </errorfile>
               <timeout>
                  240
               </timeout>
               <debuglevel>
                  1
               </debuglevel>
            </fastcgi>
            <interpreters>
               <interpreter>
                  <ext>
                     php
                  </ext>
                  <interface>
                     1
                  </interface>
                  <file>
                     /usr/bin/php5-cgi
                  </file>
                  <checkexists>
                     yes
                  </checkexists>
                  <type>
                     1
                  </type>
                  <updatepaths>
                     yes
                  </updatepaths>
               </interpreter>
            </interpreters>
            <environment>
               <var>
                  <name>
                     REDIRECT_STATUS
                  </name>
                  <value>
                     200
                  </value>
               </var>
            </environment>
         </scripting>

You could try to set the interpreter as above in the config file. You'd have to create /var/log/abyssws/ if you want the logs of the above section.
Back to top View user's profile Send private message
aprelium-support
-


Joined: 20 Feb 2009
Posts: 356

PostPosted: Thu Jul 16, 2009 11:19 am    Post subject: Re: Browser can't see "php-cgi" file to select it Reply with quote

Suscriptor,

Could you please perform the following test:
Code:
php5-cgi -v


and post the output of this command ?

Could you also configure the interpreter with "/usr/bin/php5-cgi" and the following options:

*/ CGI ISAP or Fast CGI
*/ Standard

and try to access directly your "phpinfo.php" file ?

We'll be waiting for your reply.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Visit poster's website
Suscriptor
-


Joined: 07 Jul 2009
Posts: 8

PostPosted: Thu Jul 16, 2009 4:20 pm    Post subject: Re: Browser can't see "php-cgi" file to select it Reply with quote

aprelium-support wrote:
Suscriptor,

Could you please perform the following test:
Code:
php5-cgi -v


and post the output of this command ?


Here it is:

Code:

$ ls /usr/bin/php*
lrwxrwxrwx 1 root root   21 2009-07-13 19:06 /usr/bin/php -> /etc/alternatives/php*
-rwxr-xr-x 1 root root 5.1M 2009-04-17 09:37 /usr/bin/php5*
-rwxr-xr-x 1 root root 5.0M 2009-04-17 09:37 /usr/bin/php5-cgi*
lrwxrwxrwx 1 root root   25 2009-07-15 14:11 /usr/bin/php-cgi -> /etc/alternatives/php-cgi*

$ php -v
PHP 5.2.4-2ubuntu5.6 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 17 2009 14:31:37)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

$ php-cgi -v
PHP 5.2.4-2ubuntu5.6 with Suhosin-Patch 0.9.6.2 (cgi-fcgi) (built: Apr 17 2009 14:23:39)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

$ php5 -v
PHP 5.2.4-2ubuntu5.6 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 17 2009 14:31:37)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

$ php5-cgi -v
PHP 5.2.4-2ubuntu5.6 with Suhosin-Patch 0.9.6.2 (cgi-fcgi) (built: Apr 17 2009 14:23:39)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies


They all show the same version.

Quote:

Could you also configure the interpreter with "/usr/bin/php5-cgi" and the following options:

*/ CGI ISAP or Fast CGI
*/ Standard

and try to access directly your "phpinfo.php" file ?

We'll be waiting for your reply.


I typed /usr/bin/php5-cgi , and after setting "CGI-ISAPI + Standard" Abyss couldn't restart, so I had to "kill -9" it and restart manually. After that I could access the /phpinfo.php file both ways: typing the full URL directly in the address bar first, and then I went back and clicked on the link in "index.html" and it worked also. PHP info showed the information page completely in both cases.

Then I set "CGI-ISAPI + PHP Stype" and Abyss restarted OK. PHP info file worked also.

Then I set "Fast CGI (Local - Pipes) + Standard" and Abyss restarted OK. PHP info file worked also.

Then I set "Fast CGI (Local - Pipes) + PHP Style" and Abyss restarted OK. PHP info file worked also.

What went wrong? now every combination is working. What combination should I set? "FastCGI (Local - Pipes)" + "PHP Stype" as suggested in the "PHP in Linux installation instructions" or "FastCGI (Local - Pipes) + Standard" as you suggested? The interface log files are empty:

Code:

$ ls ~/bin/abyssws/logs/
total 12K
-rw------- 1 sistemas sistemas    5 2009-07-16 09:42 abyssws.pid
-rw------- 1 sistemas sistemas 7.8K 2009-07-16 09:40 access.log
-rw------- 1 sistemas sistemas    0 2009-07-15 15:52 cgi.log
-rw------- 1 sistemas sistemas    0 2009-07-15 15:52 fastcgi.log
-rw------- 1 sistemas sistemas    0 2009-07-15 15:52 isapi.log


Why Abyss couldn't restart when trying different combinations and now restarts with every combination?

The web browser still "can't see" any of the php files in /usr/bin/.

Thank you very much for your assistance. I'm a community member at Kubuntu-es.org and on July 6th I wrote a "HOWTO install Abyss Web Server" document in the Wiki section, so that the spanish community get to know this great web server too (which I also use in MS Windows XP):

http://www.kubuntu-es.org/wiki/internet-redes/howto-como-instalar-servidor-paginas-web-abyss-web-server

I'm writing another tutorial about installing and configuring PHP, but this problem stopped me from continuing.

Thank you very much,
Suscriptor ... in MEXICO.
Back to top View user's profile Send private message
Suscriptor
-


Joined: 07 Jul 2009
Posts: 8

PostPosted: Thu Jul 16, 2009 4:43 pm    Post subject: Re: My config Reply with quote

DonQuichote wrote:
I cannot see anything wrong with what you did. The abyss runs fine on my Xubuntu systems. You mention that the config flie is generated. If you open that file (back it up first), and look under
//root/server/host/ , you see an element called "scripting" [.....] You could try to set the interpreter as above in the config file. You'd have to create /var/log/abyssws/ if you want the logs of the above section.


This is the actual scripting information in abyssws.conf file :

Code:

                        <scripting>
                                <enabled>
                                        yes
                                </enabled>
                                <cgi>
                                        <timeout>
                                                30
                                        </timeout>
                                        <useregistry>
                                                no
                                        </useregistry>
                                        <useshebang>
                                                yes
                                        </useshebang>
                                        <errorfile>
                                                log/cgi.log
                                        </errorfile>
                                </cgi>
                                <isapi>
                                        <ext>
                                                dll
                                        </ext>
                                        <errorfile>
                                                log/isapi.log
                                        </errorfile>
                                        <debuglevel>
                                                0
                                        </debuglevel>
                                </isapi>
                                <fastcgi>
                                        <errorfile>
                                                log/fastcgi.log
                                        </errorfile>
                                        <timeout>
                                                240
                                        </timeout>
                                        <debuglevel>
                                                1
                                        </debuglevel>
                                </fastcgi>
                                <interpreters>
                                        <interpreter>
                                                <ext>
                                                        php
                                                </ext>
                                                <interface>
                                                        1
                                                </interface>
                                                <file>
                                                        /usr/bin/php5-cgi
                                                </file>
                                                <checkexists>
                                                        yes
                                                </checkexists>
                                                <type>
                                                        1
                                                </type>
                                                <updatepaths>
                                                        yes
                                                </updatepaths>
                                        </interpreter>
                                </interpreters>
                                <environment>
                                        <var>
                                                <name>
                                                        REDIRECT_STATUS
                                                </name>
                                                <value>
                                                        200
                                                </value>
                                        </var>
                                </environment>
                        </scripting>


I can't tell what was the content of the file before doing what Aprelium Support suggested me to do. So this is the content of it after that. If you want me to uninstall Abyss and repeat every step until I get to the problem where I can't select the php file it's OK for me, no problem, perhaps that would help us to see what was the content of the file after setting manually the path to the interpreter and failing to restart the web server, and the error message.

I'm not using the "/var/log/abyssws/" path, but "~/bin/abyssws/logs/" for the log files, would you suggest to use the former? I know that most log files should go in /var/logs, but I have a separate partition for /home and that's why I'm using "~/bin/abyssws/"

Thank you very much,
Suscriptor ... in MEXICO.
Back to top View user's profile Send private message
aprelium-support
-


Joined: 20 Feb 2009
Posts: 356

PostPosted: Thu Jul 16, 2009 5:24 pm    Post subject: Re: Browser can't see "php-cgi" file to select it Reply with quote

Suscriptor wrote:

What went wrong? now every combination is working. What combination should I set? "FastCGI (Local - Pipes)" + "PHP Stype" as suggested in the "PHP in Linux installation instructions" or "FastCGI (Local - Pipes) + Standard" as you suggested?


We strongly recommend you to use "Fast CGI (Local - Pipes) + Standard".

For faster questions/answers exchange, can you please send your "abyss.conf" file and the informations about the issues you described to support@aprelium.com ?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Visit poster's website
Suscriptor
-


Joined: 07 Jul 2009
Posts: 8

PostPosted: Fri Jul 17, 2009 8:58 pm    Post subject: Re: Browser can't see "php-cgi" file to select it Reply with quote

aprelium-support wrote:

We strongly recommend you to use "Fast CGI (Local - Pipes) + Standard".

For faster questions/answers exchange, can you please send your "abyss.conf" file and the informations about the issues you described to support@aprelium.com ?


OK, I set it as you suggested. An e-mail message has been sent with the configuration file attached to it.

Thhank you very much,
Suscriptor ... in MEXICO.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions 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