Skip to main content
  • Guides & Documentation

Knowledgebase

Featured articles, how-to guides and quick tips.

Modifying the php.ini file on macOS Mojave

This one's simple.

First, login as root, using the following command:

sudo su

Enter your macOS user password when prompted.

Now you have root access, yay!

Follow this command to copy the default php.ini file:

cp /etc/php.ini.default /etc/php.ini

Then, edit the new php.ini file:

vi /etc/php.ini

Since the file is read-only, save it using the following command:

:wq!

The exclamation point after write-quit is to override the read-only status of the file.

Don't forget to restart Apache, using:

apachectl restart

This trick is easy and quick, so you won't have to spend any time modifying permissions if you're after a simple edit.