1

For over a day I have been trying to start a CakePHP 3 project. When I run the composer install command, I get the following error:

cakephp/cakephp 3.3.x requires ext-intl * -> the requested PHP extension intl is missing from your system.

I am using MacOS Sierra 10.12.2. XCode and all that jazz are fully up-to-date. I am running PHP 5.6.25 via MAMP Pro 4.0.1 (3985). And I am trying to install CakePHP 3.3.x through my terminal, which is using ZSH instead of Bash.

I've spent quite a while trying to get intl installed. And by now I'm pretty confident that it is indeed installed:

  1. When I run php -m I see intl in the list of PHP modules.
  2. I have extension=intl.so in my php.ini, located in /Applications/MAMP/bin/php/php5.6.25/conf/php.ini.
  3. The file intl.so is located in the directory /Applications/MAMP/bin/php/php5.6.25/lib/php/extensions/no-debug-non-zts-20131226.
  4. On MAMP's phpinfo page I can see '--enable-intl' in the Configure Command cell. Further down the page, it has its own table, showing that internationalization is supported with version 1.1.0. However, in this table, for the row intl.default_locale the value is no value. Could this be my problem?
  5. In my ~/.zshrc file I have alias php="/Applications/MAMP/bin/php/php5.6.25/bin/php" so I can be sure I'm using the correct version and installation of PHP.

I hope I haven't ruined anything by trying to use so many articles and StackOverflow answers to get this working. I know there are a number of similar intl questions here, but so far I've had no luck with any answers.

So I suppose here are my two main questions:

  1. Is the evidence I listed above enough to suggest I truly have the intl extension correctly installed, and why does CakePHP still complain about the extension being missed if it is correctly installed?
  2. If it is not correctly installed, how can I correct this and get CakePHP to install?

Thank you!

apurav gaur
  • 342
  • 7
  • 18
Steven Thate
  • 193
  • 1
  • 11
  • In a page run `phpinfo()`; and see if intl is installed. Mac's come with apache, so it's very possible that it's a different version of PHP to the one your command line is using – Farkie Jan 04 '17 at 20:29
  • Yeah, you need to see if your apache is running the extension, you also need to make sure your apache is pointing to the MAMP version of PHP that you have installed or if it is referring to the default PHP installation. – Jravict Jan 04 '17 at 20:33
  • On a mac, look in the apache httpd.conf file for this line: #LoadModule php5_module libexec/apache2/libphp5.so Be sure that this line is pointing to the MAMP php. Httpd.conf is located in /etc/apache2/httpd.conf. If you vim into the file, the line you are looking for should be near the bottom of the LoadModule section. – Jravict Jan 04 '17 at 20:36
  • I browsed to my httpd.conf file and that line was commented out, so I uncommented it. However, I'm using MAMP's apache server, not the original one on my Mac. Do I need to add this to MAMP's httpd.conf file? That one has a different syntax for its LoadModule. For example, that file has `MAMP_php_module_MAMP`. But I'm not sure if it's even pointing to the right php module? – Steven Thate Jan 04 '17 at 20:51
  • I see in my phpinfo page that in the apache2handler table, listed under Loaded Modules is `mod_php5`. Is that the same thing as `libphp5.so`? – Steven Thate Jan 04 '17 at 20:55
  • try restarting your apache2 server if you have not restarted it after you installed intl extension... apache2 needs to be restarted if any new extension is installed – justrohu Jan 05 '17 at 06:42
  • 1
    Check this link http://stackoverflow.com/questions/26285280/cakephp-3-0-installation-intl-extension-missing-from-system#answer-30025651 hope this will help – Aman Rawat Jan 05 '17 at 16:20
  • Thanks, @AmanRawat, I completely overlooked that! – Steven Thate Jan 05 '17 at 17:03
  • @swthate does that link worked for you? – Aman Rawat Jan 05 '17 at 17:08
  • @AmanRawat yes, turns out mamp php was missing from my path. i thought i had it, but it was just an alias. – Steven Thate Jan 05 '17 at 17:09
  • OK, so answer to your question so it will be helpfull for others – Aman Rawat Jan 05 '17 at 17:11

2 Answers2

4

Thank you to everyone who lent a hand in the comments. But a special thank you to Aman Rawat for pointing me to this answer. I've read through that thread a number of times, but apparently overlooked it.

I added export PATH="/Applications/MAMP/bin/php/php5.6.25/bin:$PATH" to ~/.zshrc.

I was then able to install CakePHP via composer.\

I assumed I had MAMP's PHP in my path. I had it as an alias, so php in terminal would correctly point to MAMP's PHP install, but it turns out that PHP was never actually in my PATH.

Oops!

Community
  • 1
  • 1
Steven Thate
  • 193
  • 1
  • 11
0

I think you have not enabled intl extension from php.ini file.

Javed Khan
  • 395
  • 5
  • 9
  • Go to your xampp directory and open php.ini file from "xampp\php" and find intl in php.ini file and just replace " ;extension=intl " with " extension=intl " . – Javed Khan May 28 '19 at 12:55