kenny99
kenny99

Reputation: 257

Compiling PHP 5.1.6 from source - php -v and phpinfo() version discrepancy

I have just bought a VPS running Ubuntu and I need to install the LAMP stack with PHP 5.1.6. The VPS came with no PHP installed (checked this from the shell with php -v) and with Apache/2.2.12 installed. I installed PHP 5.1.6 from source and compiled it with Apache 2.2 (using libapache2-mod-php5), tried a phpinfo() test which worked fine, however, phpinfo() shows the PHP version as 5.2.1 (with JSON enabled), whereas running php-v in the shell shows as 5.1.6. Anyone any ideas what might be happening here? I need to ensure I am running PHP 5.1.6.

Thanks in advance for any help!

Upvotes: 1

Views: 1795

Answers (1)

s1d
s1d

Reputation: 540

php -v gives you the version of the cli installation of php, while phpinfo will give you the version which got installed as apache module.

If you are not using cli php anywhere, you should be fine with running php scripts off apache. But ideally you should fix this.

Upvotes: 2

Related Questions