Linux-why copy php. ini to/usr/local/php/lib/php. ini after installing php?

Source: Internet
Author: User
Why should I copy a copy of php after installing php. ini to usrlocalphplibphp. ini I tried it. If you do not copy a copy of php, it will work normally. Why do you need to copy a copy of php from the installation package. ini to usrlocalphplibphp. under the ini directory, why should I copy a copy of php after installing php. ini to/usr/local/php/lib/php. ini
I tried to run php normally without copying a copy. Why should I copy a copy of php. ini from the installation package to the/usr/local/php/lib/php. ini directory?

Reply content:

After installing php, why copy php. ini to/usr/local/php/lib/php. ini?
I tried to run php normally without copying a copy. Why should I copy a copy of php. ini from the installation package to the/usr/local/php/lib/php. ini directory?

@ TonyX, which is currently the top one, is correct. It provides a general solution to all questions. However, there is no direct answer to this question. If I am the subject, I do not want such an answer.

Back to the landlord's question, why should we copy the file to that directory? At that time, because the configuration file directory was specified during PHP compilation, the specified directory is/usr/local/php/lib. Therefore, PHP will read php from that directory during startup. if you do not copy the configuration file of ini, the normal operation of PHP is not affected, but configuration items cannot be added. To view which Directory PHP is going to find the Configuration File, you can see it in phpinfo (). (You can run php-I under the command line), and you can see 'configuration File (php. ini) path' and 'Scan this dir for additional. ini files, which records PHP loading. ini configuration file path.

It is recommended that the subject download a PHP source code and try to compile and run it again.

On the paper, you may have to learn more about it.
-- Reading on winter nights

This is already done by the subject.

To upload messages.
-- LV's Spring and Autumn

It is better to believe in books without books.
-- Mencius with all my heart

I understand that most of the information on the Internet is spam. I need to learn how to filter information and have my own judgment.

... You don't need to make a complicated copy to that directory,
Copy to the php. ini configuration file directory specified by configure during compilation and installation ..
This is usually the/usr/local/php/etc directory.

If you do not copy the file, the file can run normally. Check which php. ini file is loaded in phpinfo.

/Usr/local/php/lib/php. ini contains some projects that you configure during compilation. If you do not configure the items, the files here are the same as the configuration items in PHP default startup, you do not have to copy the data.

If php is running, you can find phpini and put it there.

If -- with-config-file-path is not specified during php compilation, the above directory is used by default:
-- With-config-file-path = PATH
Set the path in which to look for php. ini [PREFIX/lib]

Therefore, you need to copy it to the lib directory.
When php is running, php. ini may not be available. The default parameter value will be used.

Shell: Enter php -- ini
View the PHP load configuration.

Without the php. ini file, php loads the default configuration, so no error occurs.
The php. ini file is specified to allow you to configure php more flexibly and is not required.

The copied location is the location of the parameter -- with-config-file-path during php installation. This file is specified mainly for flexible configuration.

Related Article

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.