Search code examples
phpphpmyadminapache2macos-mojave

PHP and phpMyAdmin is not working after updating to iMac OS Mojave, Catalina


You dont have enough permission to access /phpmyadmin/ on this server.

enter image description here

after updating to mac os Mojave when I browse to http://localhost/phpmyadmin/index.php I get the index.php file as text. so php isn't working

enter image description here

but when I was running php on terminal php -v is working so there isn't a problem with php.

enter image description here

I think the problem is apache isn't configured to working with php


Solution

  • I needed to tell apache to use php, so I uncommented following line in apache httpd conf

    open /etc/apache2/httpd.conf on any text editor

    uncomment following line (remove the pre # tag)

    LoadModule php7_module libexec/apache2/libphp7.so

    save the file and exit

    now apache is using php, restart apache to effect the changes

    sudo apachectl restart