Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

On MacOS (Monterey) I switched PHP version to 8.0. With MAMP 6.3 (not PRO). In my source code (PHP, Nette), when I want to work with Image library, I get error "PHP extension GD is not loaded". Its true, in my php.ini (in MAMP directory) isn`t any row with "extension=gd".

In older version PHP, the GD extension works. I can see in /Applications/MAMP/bin/php/php7.4.12/include/php/ext/gd folder. But in /Applications/MAMP/bin/php/php8.0.0/include/php/ext isn`t any "gd" folder. Why?

I tried to install some extension with PECL, but it wasn`t helpful.

Homebrew was updated to latest PHP at the beginning with:

brew tap shivammathur/php
brew install shivammathur/php/php@8.0

I tried run brew install gd or reinstall, nothing works (command finish with success).

Even when I run php -m I can see module "gd". But still there si PHP warning with not loaded extension GD

Thanks for advice!

You must be logged in to vote

Replies: 2 comments · 3 replies

Comment options

Extension gd is compiled statically with PHP for all macOS and PHP versions, so there is no need to add a extension=gd entry to a INI file.
Ref: https://github.com/shivammathur/homebrew-php/blob/master/Formula/php@8.0.rb#L135

If you have a INI file with extension=gd entry, please remove that. You can check the ini files which are loaded using the php --ini command.

If you are getting an error with the gd functions not working on the webserver you are using, please check that it is using the correct php version and try restarting it.

You must be logged in to vote
1 reply
@MikKuba
Comment options

I found only ;extension=gd in /opt/homebrew/etc/php/php8.0/php.ini, so I removed whole this line and made
brew services restart php
brew services restart httpd

and Start and Stop MAMP.

But in loaded PHPinfo http://localhost/MAMP/phpinfo.php, still I can`t see "GD" module.

Call php --ini will return:

Configuration File (php.ini) Path: /opt/homebrew/etc/php/8.0
Loaded Configuration File: /opt/homebrew/etc/php/8.0/php.ini
Scan for additional .ini files in: /opt/homebrew/etc/php/8.0/conf.d
Additional .ini files parsed: /opt/homebrew/etc/php/8.0/conf.d/ext-opcache.ini

Comment options

This tap does not support MAMP. I would recommend removing MAMP and using php from this tap with httpd from brew.

Please configure httpd as per this guide
https://getgrav.org/blog/macos-monterey-apache-multiple-php-versions

You must be logged in to vote
2 replies
@MikKuba
Comment options

I get error, when want sudo apachectl stop:

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Michal-MacBook-Pro.local. Set the 'ServerName' directive globally to suppress this message
httpd (no pid file) not running

Maybe it is caused by MAMP settings. Now I`m worry about my databases to not be deleted when removing MAMP.

@shivammathur
Comment options

Yes will have to install mysql using brew and move your databases to it.
https://getgrav.org/blog/macos-monterey-apache-mysql-vhost-apc

Or you can stick to using MAMP and remove php from this tap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.