问题
when i use php -v in terminal showing
PHP 5.3.6-13ubuntu3.9 with Suhosin-Patch (cli) (built: Sep 12 2012 19:02:11) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
But when i print phpinfo in file and execute that script in browser
I got "PHP Version 5.2.17".
My main problem is soap is not showing in browser but soap is showing in terminal.
How to resolve this problem in ubuntu 11.10.
Thanks in Advance.
回答1:
They use the different php.ini
files.
Check them.
For the CLI, use php -i | grep php.ini
For the phpinfo printed in browser, find the Loaded Configuration File
.
回答2:
Your web server (probably Apache) is configured with diferent PHP processor then system default.
System processor location (in terminal):
whereis php
PHP can be configured as a CGI module or as a module for Apache. See PHP Installation and Configuration
You can reconfigure web server or use different remote channel to run system PHP proccesor. It depends on your demand. For example SSH.
来源:https://stackoverflow.com/questions/12917099/different-php-versions-showing-in-terminal-and-browser-in-ubuntu-11-10