3

My problem is that i need to change the version of php from 4.4.9 to 5.5 on an remote server on http://www.ovh.com/

But i can't seem to be able to achieve this goal!

I have tried the recommended steps http://www.ovh.com/fr/g1207.configurer-php-web

And included the following .ovhconfig file:

app.engine=php
app.engine.version=5.5
http.firewall=none
environment=production

But when i check by phpinfo() or the command php -v, it says that i am using the php version 4.4.9

![enter image description here][1]

I am trying to run a Symfony application, which is not possible with a php of version lower than 5.3

How do i fix this problem ?

w3spi
  • 4,380
  • 9
  • 47
  • 80
Codious-JR
  • 1,658
  • 3
  • 26
  • 48
  • I'm now using Laravel and need use php5.6 minimum. I have 2 subdomain in my FTP. One is in php 5.3 (old website) and the other in php 5.6 (new website). When I read my answer below, I know everything I told you isn't right. I can update my answer. But are you still having this issue ? – w3spi Jan 07 '16 at 23:57

3 Answers3

2

You have to create a .htaccess file in /www/ and write into :

SetEnv PHP_VER 5.5
SetEnv REGISTER_GLOBALS 0
Header set cache-control "no-cache"

There is a .ovhconfig file (or create it) in the root of your FTP (before /www/) and write into :

app.engine=phpcgi
app.engine.version=auto

http.firewall=none
environment=development

Then go to the manager (v3 preferably because I'm not sure the function is available in the new interface yet) > Hébergement > Gestion de l'Accélérateur Géocache > Appuyer sur Valider pour vider le cache. (More explications here)

If this doesn't work, you should contact the OVH technical service.

w3spi
  • 4,380
  • 9
  • 47
  • 80
  • i have added the .htaccess file with the content "SetEnv PHP_VER 5_5", but when i try the command `php -v` i still get the following output PHP 4.4.9 (cgi) (built: Apr 20 2012 18:34:17) Copyright (c) 1997-2008 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies **NOTE**: The .ovhconfig file is currently on the root folder. Eg: - www .ovhconfig - sub files and folders (the dir www wnd .ovhconfig are in the same location) – Codious-JR May 25 '15 at 20:51
  • i couldn't find the option Gestion du CDN, i added a screenshot in the answer, could you please have a look, and tell me if any of the options coincide with what you are talking about? This would be very helpful, i have been struggling with this problem for the past 3 weeks. Thank you – Codious-JR May 25 '15 at 21:17
  • I made a mistake. It is not CDN, but : `Gestion de l'Accélérateur Géocache` – w3spi May 25 '15 at 21:26
  • i have done the above and Emptied Cache as you suggested. But still for `php -v` i get the same result. PHP version 4.4.9. – Codious-JR May 26 '15 at 22:47
  • any other suggestions ? Still stuck with same problem! – Codious-JR Jun 02 '15 at 18:58
0

OVH paths to different versions of PHP:

/usr/local/php5.3/bin/php  =>  PHP 5.3.29 (cli) (built: Dec 10 2014 16:59:41)
/usr/local/php5.4/bin/php  =>  PHP 5.4.38 (cli) (built: Feb 26 2015 09:53:00)
/usr/local/php5.5/bin/php  =>  PHP 5.5.22 (cli) (built: Feb 23 2015 13:12:45)
/usr/local/php5.6/bin/php  =>  PHP 5.6.6 (cli) (built: Feb 23 2015 13:13:02)
/usr/local/php7.0/bin/php  =>  PHP 7.0.2 (cli) (built: Feb  8 2016 10:58:42) ( NTS )

(from this gist)

0

As of 2022, you can put .ovhconfig in the user root or the web root.
See https://docs.ovh.com/us/en/hosting/configuring-file-ovhconfig/

If you host several websites on your hosting space, you have almost certainly configured a few Multisites. There are a number of reasons why you might decide to use a different PHP version on some of your Multisites.

To do this, you must create an .ovhconfig file for the Multisite(s), containing the desired PHP version. You can refer to the instructions set out in the Editing the .ovhconfig file section of this guide, if necessary. When you download the .ovhconfig file to your storage space, be sure to do so inside the Multisite’s root folder. You can access the root folders through the OVHcloud Control Panel, under theMultisite tab of the relevant hosting plan.

Éric
  • 437
  • 3
  • 9
PaulH
  • 2,918
  • 2
  • 15
  • 31