Current time: 11-23-2024, 06:18 AM Hello There, Guest! (LoginRegister)


Post Reply 
Update from 1.0.0 to trunk: PHP files not interpreted
Author Message
nuke3d Offline
Junior Member
*

Posts: 107
Joined: Sep 2007
Reputation: 1
Post: #1
Update from 1.0.0 to trunk: PHP files not interpreted
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!
09-16-2010 07:05 AM
Find all posts by this user Quote this message in a reply
nuke3d Offline
Junior Member
*

Posts: 107
Joined: Sep 2007
Reputation: 1
Post: #2
RE: Update from 1.0.0 to trunk: PHP files not interpreted
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...
09-16-2010 11:12 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #3
RE: Update from 1.0.0 to trunk: PHP files not interpreted
Which distro/version are you using? I would recommend using fcgid with anything >etch...
09-17-2010 04:22 PM
Visit this user's website Find all posts by this user Quote this message in a reply
nuke3d Offline
Junior Member
*

Posts: 107
Joined: Sep 2007
Reputation: 1
Post: #4
RE: Update from 1.0.0 to trunk: PHP files not interpreted
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
(This post was last modified: 09-17-2010 08:39 PM by nuke3d.)
09-17-2010 08:39 PM
Find all posts by this user Quote this message in a reply
nuke3d Offline
Junior Member
*

Posts: 107
Joined: Sep 2007
Reputation: 1
Post: #5
RE: Update from 1.0.0 to trunk: PHP files not interpreted
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.
09-18-2010 05:51 AM
Find all posts by this user Quote this message in a reply
ZiomekPL Offline
Junior Member
*

Posts: 20
Joined: Apr 2010
Reputation: 0
Post: #6
RE: Update from 1.0.0 to trunk: PHP files not interpreted
edit /etc/ispcp/fcgi/parts/php5/php.ini for new domains and sed exists files in /var/www/fcgi/
09-22-2010 12:33 AM
Find all posts by this user Quote this message in a reply
Nuxwin
Unregistered

 
Post: #7
RE: Update from 1.0.0 to trunk: PHP files not interpreted
hello

http://isp-control.net/ispcp/changeset/3319
09-22-2010 03:38 AM
Quote this message in a reply
nuke3d Offline
Junior Member
*

Posts: 107
Joined: Sep 2007
Reputation: 1
Post: #8
RE: Update from 1.0.0 to trunk: PHP files not interpreted
Ah, k... thx. I'm already maintaining a patchset with customizations Smile
09-22-2010 04:28 AM
Find all posts by this user Quote this message in a reply
MasterTH Offline
Member
***

Posts: 570
Joined: Feb 2009
Reputation: 4
Post: #9
RE: Update from 1.0.0 to trunk: PHP files not interpreted
you can also edit the php.ini of the domain which has the problem.
09-22-2010 03:32 PM
Find all posts by this user Quote this message in a reply
RatS Offline
Project Leader
******

Posts: 1,854
Joined: Oct 2006
Reputation: 17
Post: #10
RE: Update from 1.0.0 to trunk: PHP files not interpreted
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.
09-23-2010 06:27 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)