2

I am trying to run a project built in Ubuntu with PHP on fat-free framework. I am using MAMP on macOS Yosemite 10.10.1.

I imported a database successfully through phpmyadmin & following these instructions. My httpd-vhosts.conf file looks like this:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot "/Applications/MAMP/htdocs"

    <Directory "/Applications/MAMP/htdocs>
        Options -Indexes FollowSymLinks Includes 
        AllowOverride All 
        Order allow,deny
        Allow from All
    </Directory>    

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel debug 

    CustomLog ${APACHE_LOG_DIR}/access.log combined    
</VirtualHost>

The project files are located at the "htdocs" web root folder in /Applications/MAMP/htdocs. Note that when I am trying to run it in this form the Apache server throws error, it does not run. When I comment the ErrorLog section the Apache server runs properly but all I get is a blank page.

The error message in the apache_error.log is:

No such file or directory: httpd: could not open error log file /Applications/MAMP/Library/${APACHE_LOG_DIR}/error.log. Unable to open logs

1

It appears that your APACHE_LOG_DIR variable is not defined.

See this thread. It says that you need to define it in /etc/apache2/envvars. I'm not sure exactly where then envvars file would be on a Mac, but it should be with all the other apache2 configuration files.

Alternately, you should just use a hardcoded path rather than ${APACHE_LOG_DIR}. For example:

ErrorLog /Applications/MAMP/logs/error.log
CustomLog /Applications/MAMP/logs/access.log combined    
  • Now it is working as it supposed to be! – geokara1322 Dec 2 '14 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.