2.8php.ini configuration file-php Tutorial

Source: Internet
Author: User
2.8php.ini configuration file #/usr/local/php/bin/php-I | head // Check that the php. ini path is/usr/local/php/etc/php. ini

  1. 1. configure disable_function

# Vim/usr/local/php/etc/php. ini

Disable_functions = eval, assert, popen, passthru, primary, primary, passthru, exec, system, chroot, scandir, chgrp, chown, primary, primary, shell_exec, proc_get_status, ini_alter, primary, dl, pfsockopen, openlog, syslog, readlink, symlink, leak, popepassthru, stream_socket_server, popen, proc_open, proc_close

// Disable these functions

  1. 2. configure error_log

# Vim/usr/local/php/etc/php. ini

Display_errors = off // if it is on, an error is displayed in the browser access.

Log_errors = on

Error_log =/usr/local/php/logs/php_errors.log

# Mkdir/usr/local/php/logs // create a directory for generating error logs

# Chmod 777! $ // Change the permission to 777

Change error_reporting to error_reporting = E_ALL | E_STRICT

#/Usr/local/apache2/bin/apachectl graceful // reload

  1. 3. configure open_basedir

# Vim/usr/local/php/etc/php. ini

Open_basedir =/data/www/:/tmp // restrict user access to/data/www and/tmp directories only

# Vim httpd. conf // can be modified in Apache

Php_admin_value open_basedir "/data/www/:/tmp/" restrict user access

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.