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


Post Reply 
rewrite to *.php carring out the whole php file instead of executing it
Author Message
iRaS Offline
Junior Member
*

Posts: 13
Joined: Mar 2009
Reputation: 0
Post: #1
rewrite to *.php carring out the whole php file instead of executing it
i had a index.php that starts my portal system and a .htaccess file that rewrites all access to the site not matches file or directory to index.php:
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule [a-z]{2,2}.*$ index.php

(it has to beginn with a 2 letter language flag e. g. de)

but i only got the index.php to download. the index.php file should run through php-parser...

this is the way i did it all the times (also on my server running vhcs2). it have to work.

also ForceType? application/x-httpd-php does not work.

i think this is a problem of fastcgi. im using fcgid - formerly i used apache2-mod-php...

is there a configuration possibility for apache with fcgid or how to do this logic with fcgid?

anyways: i think using rewriterules to point a non .php url to a .php file is not that unusal...

Quote:Not an ispCP Bug. Please use the forum.
of course it is an bug of ispcp if i had to change the httpd.conf to handle php files with fcgid. and apache have to handle all .php files with fcgid whatever the url is. if the returned file is a application/x-httpd-php it has to go through php-parser.

I added this line to /etc/ispcp/apache/parts/dmn_php2_entry.tpl
AddHandler fcgid-script .php

(also i added this line to all vhosts instead of creating the config file new and restarted apache)

now all .php files will be parsed by php. also if they are accessed by a rewrite rule...
now i had a site where i used the ForceType directive to tell apache that this file have to be parsed with php:

Code:
<File de>
  ForceType application/x-httd-php
</File>

but with the fcgid handler only .php files - and not all files of type application/x-httpd-php - will be parsed by php. so i have to use the SetHandler directive to tell apache that this file have to be parsed with php:

Code:
<File de>
  SetHandler fcgid-script
</File>

but this only returns an internal server error (500). the directory /var/www/virtual/[...]/htdocs has AllowOverride all so that this could not be the problem.

any ideas?

my suexec.log shows this two lines with every new access:
Code:
[2009-03-22 15:25:29]: uid: (2001/vu2001) gid: (2001/vu2001) cmd: de
[2009-03-22 15:25:29]: (8)Exec format error: exec failed (de)
(This post was last modified: 03-23-2009 09:08 PM by iRaS.)
03-23-2009 12:14 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
rewrite to *.php carring out the whole php file instead of executing it - iRaS - 03-23-2009 12:14 AM

Forum Jump:


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