1

I'm setting up an Amazon Linux environment, and after installing some modules:

sudo yum install php-xml sudo yum install php-gd for example... and installing Imagick, and restarting (sudo service httpd restart) it does not seem to be installing for PHP-Apache. I'm using the official PHP7.2 in Amazon Linux 2 and oddly enough, for example xml_parser_create() does work in the php -a console, but when I put it in a php file, it causes exception when going to the php file, blank screen. Oddly enough it's not even getting the function not defined error to the /var/log/httpd logs.

phpinfo() also does not show Imagick or gd although installed.

I have checked php ini files for disabled_functions and didn't find anything else that would otherwise be an obvious breakage in the default install... is there a new way I'm supposed to enable PHP modules for the Apache php install?

5
  • 1
    there is a php.ini for the command line and one for PHP-Apache make sure they are added to both Commented Aug 29, 2018 at 5:58
  • Pay close attention to the actual INI-file used by the CLI and Apache - it is in the middle of the very first table in phpinfo() output Commented Aug 29, 2018 at 7:34
  • @IVOGELOV I didn't see any disable_function directives in any ini files though. This is a new setup so it's surprising they have it set to not load new modules by default. Commented Aug 29, 2018 at 20:11
  • As I said - running phpinfo() once through the CLI and once through Apache and then checking whether they are using the same INI file - specifically the Loaded Configuration File row (7th from top to bottom) Commented Aug 30, 2018 at 7:37
  • The reason may be also in the extension_dir directive. I had the same problem on Windows and once I replaced "ext" with the full path, it resolved the problem Commented Apr 5, 2019 at 22:11

1 Answer 1

1

As others may have noted elsewhere there is another module I think it was service php-fpm restart? that is necessary on RHL

Sign up to request clarification or add additional context in comments.

1 Comment

Easier than rebooting the server to find it magically found the modules :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.