login community faq

I've created a new Static/CGI/PHP-5.3 app, cloned an existing GitHub repo, and I'm wondering if I need to do something special to make the app use PHP 5.3. When I output phpinfo() it says that it's using 5.2.17.

Thanks in advance.

asked Jan 24 '12 at 23:15

tdavis's gravatar image

tdavis
14

Are you testing on the command-line or by making a page containing phpinfo() inside the app?

(Jan 24 '12 at 23:30) neeravk ♦♦ neeravk's gravatar image

Making a page containing phpinfo.

(Jan 25 '12 at 08:02) tdavis tdavis's gravatar image

You can enable PHP 5.3 on your application by adding the following lines to your .htaccess file:

1
2
Action php53-cgi /php53.cgi   
AddHandler php53-cgi .php

Then you need to create a symbolic link in the application directory to the php53.cgi, here is how:

1
2
cd webapps/YOUR_APPLICATION  
ln -s /home/php-cgi/php53.cgi php53.cgi

answered Jan 25 '12 at 08:18

timg's gravatar image

timg ♦♦
4714

edited Jan 28 '12 at 19:54

seanf's gravatar image

seanf ♦♦
56291220

Great, thanks! It looks like it worked without creating the symbolic link. Why isn't this in the documentation somewhere?

(Jan 25 '12 at 20:00) tdavis tdavis's gravatar image

This should already have been done for you when you created a PHP 5.3 app from the panel. The instructions above are for updating a PHP 5.2 app to PHP 5.3 one on our older servers.

(Jan 25 '12 at 20:04) neeravk ♦♦ neeravk's gravatar image

Hmm, but this was a brand new 5.3 app that I created.

(Jan 25 '12 at 20:53) tdavis tdavis's gravatar image
1

Ah, i see what happened. When I cloned my existing repo, it overwrote the .htaccess file that was automatically generated with the PHP 5.3 fix in it. Thanks for the help everyone!

(Jan 25 '12 at 22:38) tdavis tdavis's gravatar image

I have a PHP5.2 app setup on my account, and would like to switch to PHP 5.3. I've used the directions above without success. Any pointers or additional steps required? I'm on web159.

(Feb 14 '12 at 15:35) Jonathan Head Jonathan%20Head's gravatar image

These instructions were for an existing Static/CGI/PHP-5.3 application. If you have a Static/CGI/PHP-5.2 application which needs to run on PHP 5.3, there are two ways to do this:

First, you could add the following to your .htaccess file:

1
2
3
<FilesMatch \.php$> 
    SetHandler php53-fcgi
</FilesMatch>

(note that this will run the site as fastCGI)

Second (if you don't want fastCGI), you could simply create a new symlink-to-static/cgi/php53 application with the extra_info pointing at the ~/webapps/the_php52_app directory and then mount your site on this symlink application.

(Feb 15 '12 at 03:01) ryans ♦♦ ryans's gravatar image

Thanks, Ryan. Appreciate the info.

(Feb 15 '12 at 22:24) Jonathan Head Jonathan%20Head's gravatar image
showing 5 of 7 show all

The answer by timg did not work for me. What did work, was the following snippet (without any symlinks):

1
2
3
<FilesMatch \.php$>
    SetHandler php53-cgi
</FilesMatch>

Here's more information about the PHP setup at Webfaction: http://blog.webfaction.com/2012/02/a-look-at-our-php-setup/

answered Jul 31 '12 at 14:41

dbrgn's gravatar image

dbrgn
1

That worked perfectly. Thanks :)

(Sep 15 '12 at 04:04) yitwail yitwail's gravatar image

I tried adding <filesmatch klzzwxh:0000php$=""> SetHandler php53-cgi </filesmatch> to my .htaccess file found in my Wordpress app folder /webapp/my_app but it doesn't work for me. Where exactly within my .htaccess file should I add it? After #Begin Wordpress, before it or after #End Wordpress or before it?

answered Nov 19 '12 at 10:50

Dhawal's gravatar image

Dhawal
111

FilesMatch uses a regular expression to match a filename. What type of filename are you trying to match with "klzzwxh:0000php$="""?

(Nov 19 '12 at 11:24) seanf ♦♦ seanf's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×146
×8

Asked: Jan 24 '12 at 23:15

Seen: 2,001 times

Last updated: Nov 19 '12 at 11:24

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited