cgi-bin/php5.cg

11 posts / 0 new
Last post
#1 Wed, 09/28/2011 - 22:12
khairun

cgi-bin/php5.cg

Hi I'm such noob on Linux environtment.. but I made successfully install virtualmin on my Linux server (latest version). The error that i got previously was related to php modules which is everything I tried to run the any php files such index.php or etc.. it's always download the file so it makes me confuse while I'm trying to run the test.php seems to working fine...

PHP Version 5.3.5-1ubuntu7.2

System Linux domain.com 2.6.38-11-server #50-Ubuntu SMP Mon Sep 12 21:34:27 UTC 2011 x86_64 Build Date May 2 2011 22:59:33 Server API FPM/FastCGI Virtual Directory Support disabled Configuration File (php.ini) Path /etc/php5/fpm Loaded Configuration File /etc/php5/fpm/php.ini Scan this dir for additional .ini files /etc/php5/fpm/conf.d Additional .ini files parsed /etc/php5/fpm/conf.d/curl.ini, /etc/php5/fpm/conf.d/gd.ini, /etc/php5/fpm/conf.d/ldap.ini, /etc/php5/fpm/conf.d/mcrypt.ini, /etc/php5/fpm/conf.d/mysql.ini, /etc/php5/fpm/conf.d/mysqli.ini, /etc/php5/fpm/conf.d/pdo.ini, /etc/php5/fpm/conf.d/pdo_mysql.ini, /etc/php5/fpm/conf.d/pdo_sqlite.ini, /etc/php5/fpm/conf.d/sqlite.ini, /etc/php5/fpm/conf.d/sqlite3.ini, /etc/php5/fpm/conf.d/xsl.ini PHP API 20090626 PHP Extension 20090626 Zend Extension 220090626 Zend Extension Build API220090626,NTS PHP Extension Build API20090626,NTS Debug Build no Thread Safety disabled Zend Memory Manager enabled Zend Multibyte Support disabled IPv6 Support enabled Registered PHP Streams https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls

Registered Stream Filters zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*

I went to the virtual server that I just created and I set the PHP script execution mode CGI wrapper (run as virtual server owner) (enable).

Now I got another error which is... "The requested URL /cgi-bin/php5.cg/installer.php was not found on this server"

Another clue for the error i saw on the apache logs which is... "script not found or unable to stat: /home/domain/cgi-bin/php5.cg"

Yes I tried to run installer script for some application based on php and mysql... and this error smakes me think something wrong with my php configuration on apache or what...

Is there any one can help me or lead me with the solution as I'm not familiar with the error....

Wed, 09/28/2011 - 22:24
andreychek

See, I've never heard of this happening before... and then all of the sudden two folks mention that happening within two days. Another fellow was seeing that here:

https://www.virtualmin.com/node/19640

I'm not really sure how to reproduce the issue though, that doesn't happen for me.

Here's a few questions for you --

  • Which Ubuntu version are you using?

  • How did you install Ubuntu (ie, did you do it yourself after downloading the ISO image)?

  • What is the output of this command:

dpkg -l 'php'

That should get us started, we can work from there :-)

-Eric

Wed, 09/28/2011 - 22:36 (Reply to #2)
khairun

Thanks for the quick response... the ubuntu version is 2.6.38-11-server. I install refresh copy of Ubuntu server and upgrades when it cames new upgrades... installing the webmin first and then decided to try virtualmin for advance configuration by downloading and installing the files (both GPL version)

root@prodigiworld:/home/mydomain/public_html# dpkg -l 'php'
dpkg-query: error: package name in specifier 'php' is illegal: must start with an alphanumeric character

root@prodigiworld:/home/mydomain/public_html# dpkg -l php
No packages found matching php.

Hope this helps..

Thanks

Wed, 09/28/2011 - 22:52
andreychek

Howdy,

the ubuntu version is 2.6.38-11-server. I install refresh copy of Ubuntu server

Mmm, that looks like your kernel version... do you know what Ubuntu version it is? You can determine that by typing "cat /etc/issue".

installing the webmin first and then decided to try virtualmin for advance configuration by downloading and installing the files (both GPL version)

Hmm, did you install Virtualmin using the install.sh script (available in the Downloads link above)?

dpkg -l 'php'

Nuts, the forum here is mangling the code I was typing in... I had typed an asterisk on either side of the text php.

So it's: dpkg -l 'STARphpSTAR'

Except, instead of the text "STAR", enter an actual asterisk :-)

-Eric

Wed, 09/28/2011 - 23:01
khairun

Some other info..

I'm thinking that this error is below similar with my situation that I have right now.. https://www.virtualmin.com/node/17295

But I found difficulties to digest the solution and explanation..

Thanks

Wed, 09/28/2011 - 23:12
khairun

Sorry for the troubles...

Here's another info..

root@prodigiworld:~# cat /etc/issue Ubuntu 11.04 \n \l

I forgot about on how I installed the virtualmin, for sure it's not from ubuntu packages, also I did try to rerun the install.sh scrip just to overwrite the existing system/installation, but still the problem exist...

root@prodigiworld:~# dpkg -l php Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============-==============-============================================ un libapache2-mod (no description available) un libapache2-mod (no description available) un libapache2-mod (no description available) un php-pear (no description available) un php5 (no description available) ii php5-cgi 5.3.5-1ubuntu7 server-side, HTML-embedded scripting languag un php5-cli (no description available) ii php5-common 5.3.5-1ubuntu7 Common files for packages built from the php ii php5-curl 5.3.5-1ubuntu7 CURL module for php5 ii php5-fpm 5.3.5-1ubuntu7 server-side, HTML-embedded scripting languag ii php5-gd 5.3.5-1ubuntu7 GD module for php5 un php5-json (no description available) ii php5-ldap 5.3.5-1ubuntu7 LDAP module for php5 ii php5-mcrypt 5.3.5-0ubuntu1 MCrypt module for php5 un php5-mhash (no description available) ii php5-mysql 5.3.5-1ubuntu7 MySQL module for php5 un php5-mysqli (no description available) ii php5-sqlite 5.3.5-1ubuntu7 SQLite module for php5 un php5-suhosin (no description available) ii php5-xsl 5.3.5-1ubuntu7 XSL module for php5 un phpapi-2009062 (no description available) ii phpmyadmin 4:3.3.10-1 MySQL web administration tool

Again thank you for your warm response :-)

Cheers...

Thu, 09/29/2011 - 02:28 (Reply to #6)
khairun

Also I found that on the apache error logs...

"script not found or unable to stat: /home/mydomain/cgi-bin/php5.cg"

Dont you think is supposed to

"script not found or unable to stat: /home/mydomain/cgi-bin/php5.cgi"

There is php5.cgi on the cgi-bin folder, let me know if this causing the problems...

Well, I remember that I intended to use fastcgi for this virtualmin installation, and I read on several discussion that the fastcgi is not really working well with Virtualmin? is that true??

Thanks,

Thu, 09/29/2011 - 09:19
andreychek

Howdy,

Well, two things... one, it looks like the Ubuntu version you have there isn't one of the supported versions, and the installer wouldn't be able to configure things correctly.

If you haven't gotten far in configuring this server -- even if it doesn't solve this specific problem, you might benefit from using the most recent supported Ubuntu version, 10.04 LTS. You'll run into less issues over the long haul. You can see a list of supported distros and versions here:

http://www.virtualmin.com/os-support.html

If it's possible to do that, my suggestion would be to install Ubuntu 10.04 LTS (server edition), and then use the install.sh from the Download link at the top of the page in order to install Virtualmin (and all of it's dependencies).

Two, I just wanted to verify what you said -- you mentioned that putting phpinfo() in a script named test.php worked -- are you saying the same script named index.php doesn't work?

-Eric

Fri, 09/30/2011 - 18:18
andreychek

Howdy,

That's true, it is... however, that should be just fine, that's the default on a Virtualmin system. There are security benefits to running it via CGI rather than as an Apache module.

There are some PHP apps that don't always play nice with that though.

There's two things you could try --

  1. In your $HOME/etc/php.ini file, try setting this option:

cgi.fix_pathinfo=0

  1. If that doesn't help, you could always switch it to use mod_php rather than CGI or FCGID. To do that, you can go into Server Configurations -> Website Options, and you can change the PHP Execution Mode setting.

    -Eric

Tue, 10/11/2011 - 20:21 (Reply to #12)
khairun

Hi Andrey, sorry for the long response, i just got time to play again with Virtualmin, but before continue with your suggestion. I would like to inform you that I got impression form the application support that I had problem with my Apache rewrite... I know i supposed to place this question on differences forum but I'm thinking that there might be user experiences the same problem like I do so i just want to share it with you all. They said that.. "your system, I don't know why, doesn't have configured right the apache rewrite module, so the "/" doesn't work properly."

And they suggest me to enable the "enable the rewrite module"

Which is I did on global configuration inside webmin. but it doesnt seem to help...

#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
#     which responds to requests that aren't handled by a virtual host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "foo.log"
# with ServerRoot set to "/etc/apache2" will be interpreted by the
# server as "/etc/apache2/foo.log".
#
 
### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#
 
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
 
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
LockFile ${APACHE_LOCK_DIR}/accept.lock
 
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}
 
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
 
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
 
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
 
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15
 
##
## Server-Pool Size Regulation (MPM specific)
## 
 
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>
 
# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
#              graceful restart. ThreadLimit can only be changed by stopping
#              and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>
 
# event MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_event_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>
 
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
 
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
 
AccessFileName .htaccess
 
#
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy all
</Files>
 
#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain
 
 
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
 
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log
 
#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
 
# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf
 
# Include all the user configurations:
Include httpd.conf
 
# Include ports listing
Include ports.conf
 
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
 
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
 
# Include generic snippets of statements
Include conf.d/
 
# Include the virtual host configurations:
Include sites-enabled/
<code>
Tue, 10/11/2011 - 20:48
khairun

Hi Andrey,

soon I select the enable CGI wrapper, I can not uncheck to try something else... PHP script execution mode CGI wrapper (run as virtual server owner)

Topic locked