vladgh / VladGh.com-LEMP

Latest NginX, MySQL, PHP (with APC and Suhosin)
http://vladgh.com/blog/install-nginx-and-php-php-fpm-mysql-and-apc
Apache License 2.0
160 stars 41 forks source link

Installing PHP5-CLI.. #22

Closed erwansalim closed 12 years ago

erwansalim commented 12 years ago

Dear Vladgh,

I am currently installing a new Ubuntu 12.04 LTS.

I need to install php5-cli, so I install it using apt-get: sudo apt-get install php5-cli

However, it install the 5.3.10 version of php5-cli, not the php 5.4.3 version

Please help.

Regards,

erwansalim commented 12 years ago

Dear Vladgh,

Sorry, I think I forget this command: alias php='/opt/php5/bin/php'

Regards,

vladgh commented 12 years ago

CLI is installed together with 5.4.3. By installing the php5-cli package you only overwrite the compiled version with the packaged version.

You also don't need to create an alias for the php executable because this script adds the correct paths to /etc/environment. You do however need to manually reload this file after the script finishes as instructed in the README: source /etc/environment

You also need to be aware that your shebang line for your cli scripts needs to be #!/opt/php5/bin/php -q instead of the typical #!/usr/bin/php -q.