LAMP 2.8 php.ini Configuration file detailed

Source: Internet
Author: User

Modify PHP config file, but sometimes we do not know the path of php.ini, this time we need to pass
Order to find out where.

/usr/local/php/bin/php-i |head
Look at that line Loaded Configuration File--/usr/local/php/etc/php.ini. If this is none, then the description is not loaded into the specific php.ini. After finding the php.ini, open it with vim and find that many lines are in the beginning, and this symbol is used as an annotation symbol in php.ini, that is to say, the lines that begin are not working. The common configuration in php.ini is as follows:

Search Disable_functions First

Disable_functions is configured as follows, PHP's disable function

Eval,assert,popen,passthru,escapeshellarg,escapeshellcmd,passthru,exec,system,chroot,scandir,chgrp,chown, Escapeshellcmd,escapeshellarg,shell_exec,proc_get_status,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog, Readlink,symlink,leak,popepassthru,stream_socket_server,popen,proc_open,proc_close

The error log is then configured

Open configuration file

Modify

display_error=offlog_errors=onerror_log=/usr/local/php/logs/error.log

The first one is that the page displays an error message,

The second one is the error log.

The third one is the path to the error log

If the error log path does not exist,

mkdir/usr/local/php/logs/

Because the error log is written by Apache, authorization 777

777 /usr/local/php/logs/

Format of the configuration log, level of log

Search error_reporting

Find error_reporting= E_all & ~e_deprecated & ~e_strict

error_reporting = E_all & ~e_notice

Configuration complete, restart Apache

/usr/local/apache2/bin/apachectl Graceful

The error message will be

Ls/usr/local/php/logs/php_errors.log

Configuring security options, restricting file directories

Find Open_basedir =

Open_basedir =/data/www:/tmp

Can also be configured in Apache

Open the virtual host configuration file

Specify directory for non-access virtual hosts

Add a sentence to the virtual host configuration

" /data/www/:/tmp/ "

LAMP 2.8 php.ini Configuration file detailed

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.