ispCP - Board - Support
Update from 1.0.0 to trunk: PHP files not interpreted - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: Update/Upgrade (/forum-44.html)
+--- Thread: Update from 1.0.0 to trunk: PHP files not interpreted (/thread-11675.html)

Pages: 1 2


Update from 1.0.0 to trunk: PHP files not interpreted - nuke3d - 09-16-2010 07:05 AM

Hi, I've made an update today from v 1.0.0 to the current trunk. After clearing the tickets table the updated ran fine (the updated failed when updating this table so I just emptied it).

Now the problem is that PHP code is not run but displayed to the user when opening a page. Couriously enough this only applies to customer pages not to the admin interface.

I've been on this for hours now and I have absolutely no idea how to further debug this. I'd be glad to hear your ideas on this subject and I'll try to supply you with as much information as possible:

in ispcp.conf
Quote:PHP_FASTCGI = fcgid

PHP5_FASTCGI_BIN = /usr/bin/php5-cgi

PHP_VERSION = 5

PHP_TIMEZONE = Europe/Zurich

suexec.log, all fine
Quote:[2010-09-15 22:36:18]: uid: (2010/vu2010) gid: (2010/vu2010) cmd: php5-fcgi-starter
[2010-09-15 22:36:19]: uid: (2010/vu2010) gid: (2010/vu2010) cmd: php5-fcgi-starter
[2010-09-15 22:36:20]: uid: (2010/vu2010) gid: (2010/vu2010) cmd: php5-fcgi-starter
[2010-09-15 22:36:21]: uid: (2010/vu2010) gid: (2010/vu2010) cmd: php5-fcgi-starter
[2010-09-15 22:36:23]: uid: (2010/vu2010) gid: (2010/vu2010) cmd: php5-fcgi-starter
[2010-09-15 22:36:52]: uid: (2010/vu2010) gid: (2010/vu2010) cmd: php5-fcgi-starter
[2010-09-15 22:39:32]: uid: (2010/vu2010) gid: (2010/vu2010) cmd: php5-fcgi-starter
[2010-09-15 22:42:02]: uid: (2000/vu2000) gid: (2000/vu2000) cmd: php5-fcgi-starter
[2010-09-15 22:42:05]: uid: (2010/vu2010) gid: (2010/vu2010) cmd: php5-fcgi-starter

/var/log/apache2/users/domain.com-error.log
Quote:[Wed Sep 15 22:54:24 2010] [notice] mod_fcgid: call /var/www/virtual/domain.com/htdocs/index.php with wrapper /var/www/fcgi/domain.com/php5-fcgi-starter
[Wed Sep 15 22:54:24 2010] [error] [client IP] File does not exist: /var/www/virtual/domain.com/htdocs/favicon.ico, referer: http://domain.com/
[Wed Sep 15 22:54:25 2010] [error] [client IP] File does not exist: /var/www/virtual/domain.com/htdocs/favicon.ico, referer: http://domain.com/

/var/log/apache2/other_vhosts_access.log (weird that this isn't in the correct file domain.com-access.log)
Quote:domain.com:80 IP - - [15/Sep/2010:22:54:24 +0200] "GET / HTTP/1.1" 200 1119 "-" "Opera/9.80 (Windows NT 6.1; U; en) Presto/2.6.30 Version/10.62"
domain.com:80 IP - - [15/Sep/2010:22:54:24 +0200] "GET /favicon.ico HTTP/1.1" 404 589 "http://domain.com/" "Opera/9.80 (Windows NT 6.1; U; en) Presto/2.6.30 Version/10.62"
domain.com:80 IP - - [15/Sep/2010:22:54:25 +0200] "GET / HTTP/1.1" 200 1119 "-" "Opera/9.80 (Windows NT 6.1; U; en) Presto/2.6.30 Version/10.62"
domain.com:80 IP - - [15/Sep/2010:22:54:25 +0200] "GET /favicon.ico HTTP/1.1" 404 589 "http://domain.com/" "Opera/9.80 (Windows NT 6.1; U; en) Presto/2.6.30 Version/10.62"

apache2 error.log is empty

php5-fcgi-starter
Quote:#!/bin/sh

umask 022

PHPRC="/var/www/fcgi/tf2.ch/php5/"
export PHPRC

PHP_FCGI_CHILDREN=2
export PHP_FCGI_CHILDREN

PHP_FCGI_MAX_REQUESTS=500
export PHP_FCGI_MAX_REQUESTS

#ulimit -t 30

exec /usr/bin/php5-cgi

How can I get further debug information on how the request is handled?

Thanks a lot!


RE: Update from 1.0.0 to trunk: PHP files not interpreted - nuke3d - 09-16-2010 11:12 AM

Some additional information:

- When I go to http://domain.com the PHP code is not interpreted and the index.php is printed out to the user.
- When I rename the index.php to index.php.old fcgid apparently tries to run it directly but fails because it's not an executable (!!! could this be a security hole? Seems like arbitrary executables could be run by the user. Only with his own credentials, but stil...). The line in suexec.log then reads:
Quote:uid: (2010/vu2010) gid: (2010/vu2010) cmd: index.php.old
and then some error message.
- When I rename index.php to index.old it wants to download the file as expected
- When I then change the line
Quote:FCGIWrapper /var/www/fcgi/domain.com/php5-fcgi-starter .php
in "/etc/apache2/sites-enabled/ispcp.conf" to
Quote:FCGIWrapper /var/www/fcgi/domain.com/php5-fcgi-starter .old
It correctly runs the index.old file as a PHP script! Mind = blown...


RE: Update from 1.0.0 to trunk: PHP files not interpreted - kilburn - 09-17-2010 04:22 PM

Which distro/version are you using? I would recommend using fcgid with anything >etch...


RE: Update from 1.0.0 to trunk: PHP files not interpreted - nuke3d - 09-17-2010 08:39 PM

It's a Debian Lenny, and I'm using fcgid. Here are the loaded modules:
Quote:# apache2ctl -t -D DUMP_MODULES
Loaded Modules:
core_module (static)
log_config_module (static)
logio_module (static)
mpm_worker_module (static)
http_module (static)
so_module (static)
actions_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_file_module (shared)
authz_default_module (shared)
authz_groupfile_module (shared)
authz_host_module (shared)
authz_user_module (shared)
cgi_module (shared)
cgid_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
fcgid_module (shared)
mime_module (shared)
negotiation_module (shared)
proxy_module (shared)
proxy_http_module (shared)
rewrite_module (shared)
setenvif_module (shared)
ssl_module (shared)
status_module (shared)
suexec_module (shared)
Syntax OK



RE: Update from 1.0.0 to trunk: PHP files not interpreted - nuke3d - 09-18-2010 05:51 AM

If I replace
Quote:<?
with
Quote:<?php
it works! Now, why does this only apply to .php files? As stated above, if I rename it to .old and change the fcgid line to handle .old files it works even with
Quote:<?

Seems like short_open_tag was changed to Off in ispcp, this breaks all of my hosted php sites.


RE: Update from 1.0.0 to trunk: PHP files not interpreted - ZiomekPL - 09-22-2010 12:33 AM

edit /etc/ispcp/fcgi/parts/php5/php.ini for new domains and sed exists files in /var/www/fcgi/


RE: Update from 1.0.0 to trunk: PHP files not interpreted - Nuxwin - 09-22-2010 03:38 AM

hello

http://isp-control.net/ispcp/changeset/3319


RE: Update from 1.0.0 to trunk: PHP files not interpreted - nuke3d - 09-22-2010 04:28 AM

Ah, k... thx. I'm already maintaining a patchset with customizations Smile


RE: Update from 1.0.0 to trunk: PHP files not interpreted - MasterTH - 09-22-2010 03:32 PM

you can also edit the php.ini of the domain which has the problem.


RE: Update from 1.0.0 to trunk: PHP files not interpreted - RatS - 09-23-2010 06:27 AM

When I replaced the php.ini file, they had "short_open_tag = Off" (default value) for PHP5, in PHP4 it was still on. There is an ongoing discussion in the PHP mailing is to deprecate it. I'd say nuke3d should activate it in the php.ini files of the domains that need it and we should revert r3319 back.