How to install php CLI version for symfony2 without changing code?

My setting

  • shared hosting
  • lack of root access
  • shell access
  • symfony 2.1
  • capifony for deployment (well, at least this plan)

build_bootstrap.php uses

 #!/usr/bin/env php 

This is due to php4 cli in

 /usr/local/bin/php 

PHP4, of course, does not work. Php 5.3 cli is in

 /usr/local/bin/php53 

Is there a central place to tell symfony 2.1 about env change? Something with a confusion? Export paths to bash configuration files?

Update:

Now I use an alias for php in my bashrc, as @thecatontheflat suggested.

Unfortunately, Symfony brings its own logic where to look for php binary files. One option is to install PHP_PATH via putenv. I added it both in app / console and app / autoload.php, since both files are involved in Capifony tasks

+4
source share
1 answer

Decision:

add two settings to .bashrc / .bash_profile

 alias php="/usr/local/bin/php53" export PHP_PATH = "/usr/local/bin/php53" 

and also set php_bin in Capifony deploy.rb

 set :php_bin, " /usr/local/bin/php53" 
+2
source

Source: https://habr.com/ru/post/1445568/


All Articles