Nginx has multiple php versions. How can I choose which one to use?

Source: Internet
Author: User
Macpro, php5.6 is installed with homebrew, and php-v is 5.6 in the terminal, but phpinfo () is accessed through the nginx server on the web page () it shows that php5.5 is still used by the system. This is the latest one. How can I solve the Mac pro problem? I installed php 5.6 with homebrew. in the terminal, php-v shows 5.6, but through the nginx server, accessing phpinfo () on a web page shows that php5.5 is still useless.
How can this problem be solved?

Reply content:

For Mac pro, php 5.6 is installed with homebrew. in the terminal, php-v is 5.6, but phpinfo () is accessed through the nginx server on the web page () it shows that php5.5 is still used by the system.
How can this problem be solved?

Nginx interacts with php through fascgi.
So you can modify the nginx configuration, listen to the php-fpm port of php5.6, and then restart nginx.
Google.

Make sure that the current HTTP server is nginx.

Nginx is generally used in combination with PHP-fpm. They are independent and interact with each other through the local network according to the FastCGI standard protocol. Therefore:

Stop the self-starting PHP-fpm Version 5.5, and add PHP-fpm version 5.6 to the auto-starting version to solve the problem.

This is because mac comes with php

The mac OS system provides many common environments for us. We do not need to install everything like windows, such as ruby, python, and php, before installing the environment you need, run the following command to verify whether the installation is complete.

5.5 is enough. Of course, I use the xampp integrated environment,
If you want to use homebrew, add the installed php location to the environment variable,
Edit.bash_profileAdd this sentence to the fileexport PATH=/Applications/XAMPP/xamppfiles/bin:$PATH
Set/Applications/XAMPP/xamppfiles/binReplace it with your own php Directory

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.