Linux-install PHP why copy a php.ini to/usr/local/php/lib/php.ini

Source: Internet
Author: User
Tags php compiler php source code
Install PHP Why do you want to copy a php.ini to/usr/local/php/lib/php.ini?
I tried. If you do not copy PHP, it will work. Why copy a php.ini from the installation package to the/usr/local/php/lib/php.ini directory?

Reply content:

Install PHP Why do you want to copy a php.ini to/usr/local/php/lib/php.ini?
I tried. If you do not copy PHP, it will work. Why copy a php.ini from the installation package to the/usr/local/php/lib/php.ini directory?

The @TonyX at the top of the list is right, and gives a general way to solve all the problems. But there is no direct answer to this question, and if I am the master, I do not want the answer.

Back to the landlord question, why to copy to that directory, at that time because the PHP compiler specified the configuration file directory, and the specified directory is/usr/local/php/lib so PHP startup will go to that directory to read the php.ini configuration file, not copy does not affect the normal operation of PHP, Just can't add configuration items. To see what directory the current PHP will go to find the configuration file, you can see in Phpinfo (), (command line run php-i can also), see ' Configuration file (php.ini) Path ' and ' Scan this dir for a dditional. ini files ', which records the path of the PHP load. ini configuration file.

The main topic is to download a PHP source code to try to compile and run it again.

The paper came to the end of the light, I know this matter to preach.
--"Winter night reading of the child Pei"

The Lord has done it.

Baseless assertion
--"Lu Spring and Autumn"

It is better to have no books than to do letters.
--"Mencius."

The main understanding of the Internet is the majority of information is rubbish, to learn to screen information, to have their own judgment, practice the truth.

。。。 There's no need for a complicated one to that directory.
Copy to the php.ini configuration file directory that you specified configure when you compiled the installation.
This directory is generally/usr/local/php/etc.

You do not copy also can run normal, you see phpinfo inside Loaded is which php.ini.

/usr/local/php/lib/php.ini There are some projects you configure at compile time, if you do not configure then the files here and PHP default startup time related configuration items are the same, you do not need to copy.

As long as PHP can find Phpini at runtime, you can put it there.

Compile-time PHP, if you do not specify--with-config-file-path, the default is the above directory:
--with-config-file-path=path
Set the path in which-to-look for php.ini [Prefix/lib]

Therefore, it needs to be copied to the Lib directory.
PHP can run without php.ini, and default parameter values will be used.

Shell type PHP--ini
View the PHP-loaded configuration.

Without the php.ini file, PHP will load the default configuration, so there will be no error.
The php.ini file is specified to give you more flexibility in configuring PHP, which is not required

Copy to location is the location of the parameter--with-config-file-path when the PHP is installed, this file is specified for flexible configuration

  • 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.