Osx-why is the php version displayed on the terminal different from the php version used by Apache?

Source: Internet
Author: User
The system comes with php 5.5.27, And I have installed php 5.3.29 myself. In the terminal, the php-v version is 5.3.29, but when the browser opens localhost, it uses 5.5.27. It is strange, why? How can I use 5.3 For localhost? The built-in php is 5.5.27I installed 5.3.29. Use in a terminal Php-vThe version is 5.3.29But when the browser opens localhost 5.5.27That's strange. Why? How can I use localhost? 5.3?

Reply content:

The built-in php is5.5.27I installed5.3.29. Use in a terminalPhp-vThe version is5.3.29But when the browser opens localhost5.5.27That's strange. Why? How can I use localhost?5.3?

1. Start 5.3 of php-fpm. If nginx is used as the web server
2. Modify the php parsing configuration in the web server configuration file. If nginx is used, modify fastcgi_pass. If apache is used, modify LoadModule and AddType.

Php-v displays the php version configured in environment variables.
The version displayed for localhost access is the php version loaded by the Apache or nginx configuration file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.