apache - Installing Laravel while there are 2 php packages installed -
i have install laravel 4 on old server has ubuntu 10.04 server installed lamp (php v5.3.10). have ran following commands;
sudo add-apt-repository ppa:ondrej/php5-oldstable sudo apt-get update sudo apt-get upgrade sudo apt-get install php5 sudo apt-get install php5-mysql php5-json php5-mcrypt curl -ss https://getcomposer.org/installer | php5 sudo mv composer.phar /usr/local/bin/composer composer create-project laravel/laravel --prefer-dist problem 1 laravel/framework v4.2.9 requires php >=5.4.0 -> no matching package found.
i have uninstalled , reinstalled different commands no avail. know laravel installer referring lamp's installed php package. checking versions;
php -v php 5.3.10 suhosin-patch (cli) (built: mar 5 2012 18:10:34) copyright (c) 1997-2012 php group zend engine v2.3.0, copyright (c) 1998-2012 zend technologies php5 -v php 5.4.33-1+deb.sury.org~lucid+1 (cli) (built: sep 19 2014 11:21:37) copyright (c) 1997-2014 php group zend engine v2.4.0, copyright (c) 1998-2014 zend technologies
how can make refer newer php5 package instead of old one? can't update lamp package many other projects being run on it.
this not laravel problem. laravel executed php, executed apache.
so need configure apache virtual host you, here's virtual hosts file run 2 different versions of php in same host, might should start solving problem:
<virtualhost *:80> servername testphp540.com documentroot /var/www <directory /> options followsymlinks allowoverride addhandler php-cgi .php action php-cgi /cgi-bin-php/php-cgi-5.4.0 </directory> errorlog /var/log/apache2/error.log loglevel warn customlog /var/log/apache2/access.log combined </virtualhost> <virtualhost *:80> servername testphp550.com documentroot /var/www <directory />virtual host options followsymlinks allowoverride addhandler php-cgi .php action php-cgi /cgi-bin-php/php-cgi-5.5.0 </directory> errorlog /var/log/apache2/error.log loglevel warn customlog /var/log/apache2/access.log combined </virtualhost> <virtualhost *:80> servername testphp556.com documentroot /var/www <directory /> options followsymlinks allowoverride addhandler php-cgi .php action php-cgi /cgi-bin-php/php-cgi-5.5.6 </directory> errorlog /var/log/apache2/error.log loglevel warn customlog /var/log/apache2/access.log combined </virtualhost>
here's full how to: http://www.distrogeeks.com/install-multiple-php-versions-in-ubuntu-lamp-server/. , searching on google "running multiple php versions" should you.
Comments
Post a Comment