apache How to create virtual host in Apache PHP Development Virtual Host

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!


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

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

Got any apache Question?