apache tutorial - PHP Development Virtual Host - apache - apache web server - apache server - apache2




PHP Development Virtual Host in Apache

This is an example on how to control PHP error logging in a virtual host site for development and debugging. Assumptions

  • The PHP module has been installed.
  • Development environment is not for production.
<VirtualHost *:80>
    ServerName example.com
    DocumentRoot /var/www/domains/example.com/html
    ErrorLog /var/www/domains/example.com/apache.error.log
    CustomLog /var/www/domains/example.com/apache.access.log common
    php_flag log_errors on
    php_flag display_errors on
    php_value error_reporting 2147483647
    php_value error_log /var/www/domains/example.com/php.error.log
</VirtualHost>
click below button to copy the code. By Apache tutorial team

Note: The Virtual Host configuration is for development only because the display_errors is enabled and you do not want that in production.


Related Searches to PHP Development Virtual Host in Apache