This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » Installation and setup » php php5 file extensions problem [SOLVED]
icon5.gif  php php5 file extensions problem [SOLVED] [message #7987] Tue, 27 June 2006 12:25 Go to next message
pezetgee
Messages: 734
Registered: March 2006
Faithful Member

In order to use PHP5 on my web host I need to change script file's extensions to php5, what basically breaks my app.
I cannot use AddHandler directive in .htaccess file, as the host doesn't support it as well Sad

So far, I started analysing logs and found that sfWebRequest gets incorrect request parameters. Instead of ( module => "my_module_name", action => "my_action" ) I get ( module => "5", action => "my_module_name" )

The '5' comes then from php5 as apposed to php

I'm starting to fiddle around symfony code, however if someone had that experience before and found a way around that would probably save me lots of time..


Thanx a lot in advance,

Peter




[Updated on: Wed, 28 June 2006 09:20]

Re: PHP4 / PHP5 extensions problem [message #7989 is a reply to message #7987 ] Tue, 27 June 2006 12:44 Go to previous messageGo to next message
pezetgee
Messages: 734
Registered: March 2006
Faithful Member
I got it to work by modifying sfWebRequest.class.php

It seems to work, but I'd like someone from symfony development team to comment if that was good way to do it.

The changes:
1.
public function getPathInfo()
[...]

replaced lines
if ($pos = stripos($pathInfo, '.php'))
{
$pathInfo = substr($pathInfo, $pos + 4)
}
with
if ($pos = stripos($pathInfo, '.php5'))
{
$pathInfo = substr($pathInfo, $pos + 5)
}


2.
public function getRelativeUrlRoot()
[...]

replaced line
%this->relativeUrlRoot = preg_replace('#/[^/]+\.php$#', '', $pathArray['SCRIPT_NAME']);
with
%this->relativeUrlRoot = preg_replace('#/[^/]+\.php5$#', '', $pathArray['SCRIPT_NAME']);


Now testing all app...
Peter

[Updated on: Tue, 27 June 2006 18:22]

icon8.gif  Re: PHP4 / PHP5 extensions problem [message #7994 is a reply to message #7989 ] Tue, 27 June 2006 13:26 Go to previous messageGo to next message
pezetgee
Messages: 734
Registered: March 2006
Faithful Member
All seems to work ok.

[Updated on: Wed, 28 June 2006 09:22]

icon14.gif  Re: php php5 file extensions problem [SOLVED] [message #9211 is a reply to message #7987 ] Fri, 21 July 2006 22:09 Go to previous message
z01d  is currently offline z01d
Messages: 160
Registered: December 2005
Senior Member
I have the exactly the same problem! My host allows PHP5 as a CGI an so you have to add .php5 extension to the controller script.

Described in detail here:
http://www.symfony-project.com/forum/index.php/m/9210/

Thanks for postiong your solution, pezetgee! Smile
I am using version 6.2. Don't know if this is fixed in 6.3, but it should be.
Previous Topic:Moving project to host - "frontend_dev.php5 not found"
Next Topic:Pear Upgradation Problem
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software