Environment setup-an unsolved problem during php installation (google failed N times)

Source: Internet
Author: User
Tags mcrypt
This question has been tried by Baidu. google has failed to find a satisfactory answer many times. After installing php, print phpinfo () and a "LoadedConfigurationFile" option will be displayed. This option is used to load php. INI file, php. some extensions (such as red...
  1. Google has not found a satisfactory answer to this question many times.

  2. After installing php, print phpinfo () and a "Loaded Configuration File" option will be displayed,
    This option is used to load the php. ini file. Some extensions (such as redis. so, phalcon. so, mcrypt. so...) may be loaded in the php. ini file .....)

  3. I am using the Linux + Nginx (1.6.2) + Mysql + PHP (5.6.1) Environment, php installation directory:/usr/local/php5.6, php exists under/usr/local/php5.6/lib. INI file, but I did not load this INI file. According to the printed phpinfo information, the loaded INI file is/usr/local/lib/php. ini

  4. Now the problem is coming. I want to load php. the INI file is/usr/local/php5.6/lib/php. ini instead of/usr/local/lib/php. ini, how can I customize the php. INI file.

  5. Other php versions have been installed on the computer, but they are no longer used. The/etc/profile environment variable uses php5.6, which is newly installed. I have tried many ways to load the php. ini file in the Custom location (for example, setting the INI file environment variable and adding -- with-config-file-path when compiling php)

  6. Back to the topic, how to customize the php. ini File path (that is, the File path in the Loaded Configuration File option in the printed phpinfo)

  7. There are a lot of solutions for google. I read a lot of answers, but they are not what I want. Hurry up and make a move.

Reply content:
  1. Google has not found a satisfactory answer to this question many times.

  2. After installing php, print phpinfo () and a "Loaded Configuration File" option will be displayed,
    This option is used to load the php. ini file. Some extensions (such as redis. so, phalcon. so, mcrypt. so...) may be loaded in the php. ini file .....)

  3. I am using the Linux + Nginx (1.6.2) + Mysql + PHP (5.6.1) Environment, php installation directory:/usr/local/php5.6, php exists under/usr/local/php5.6/lib. INI file, but I did not load this INI file. According to the printed phpinfo information, the loaded INI file is/usr/local/lib/php. ini

  4. Now the problem is coming. I want to load php. the INI file is/usr/local/php5.6/lib/php. ini instead of/usr/local/lib/php. ini, how can I customize the php. INI file.

  5. Other php versions have been installed on the computer, but they are no longer used. The/etc/profile environment variable uses php5.6, which is newly installed. I have tried many ways to load the php. ini file in the Custom location (for example, setting the INI file environment variable and adding -- with-config-file-path when compiling php)

  6. Back to the topic, how to customize the php. ini File path (that is, the File path in the Loaded Configuration File option in the printed phpinfo)

  7. There are a lot of solutions for google. I read a lot of answers, but they are not what I want. Hurry up and make a move.

Both php and php-fpm can specify the directory of the php. ini file through the-c parameter:
Php-h and php-fpm-h visible

-c 
  
   |
   
     Look for php.ini file in this directory
   
  

You can set the path through configure-related configuration items during compilation and installation. For details, see./configure -- help to view the php help documentation!

-- With-config-file-path =/usr/local/php5.6/lib/php. ini storage location
-- With-config-file-scan-dir =/usr/local/php5.6/lib/conf. d extension file directory

You can manually enable php-fpm to determine the location of the loaded php. ini php-fpm.conf by specifying the-c parameter, but the default location can only be specified by compiling the configure Parameter

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.