I'm want to start using phpDocumentor and the manual installation keeps throwing an error about me not having set detect_unicode = Off in my php.ini in Terminal.
When I add it to my php.ini it doesn't take and I get the same issue when running the install. Nobody seems to have this problem, and for the life of me I can't figure it out.
https://github.com/phpDocumentor/phpDocumentor2/blob/develop/README.md#installation
What am I missing? (I did restart the MAMP server after the php.ini edit)
Screenshot of the error in terminal...
If you have MAMP/MAMP Pro installed then the problem is that the PHP version available to your terminal will most probably be the system version located in:
I had the same problem but in my case I didn't have a php.ini file in that directory so the best way to resolve it is to just create a symbolic link to the PHP version currently in use in your MAMP/MAMP Pro installation:
That solves the issue. Just change the php version
php5.3.14
to whatever version of PHP you've selected to use in MAMP.As @moderndegree mentions above, you can then optionally make this available to the terminal in the future by editing your path variable in your bash/zsh/etc:
I faced the same problem for composer-php and i add this line manually into php.ini file. Like this:
then add this line "detect_unicode = Off"
then its work and i installed composer. You can see this How to disable "detect_unicode" setting from php.ini? (trying to install Composer)
You must not be editing the right php.ini if it still is enabled. Run
php -i | grep ini
to find all the ini files that are loaded.The relevant lines are those two:
If you can't change your /usr/local/bin/php/php.ini file, remember to keep using '-d detect_unicode=Off' for all your php calls like so:
If you are able to change your php.ini file, then add the following to the end of your
php.ini
:As I remember, MAMP uses configuration templates. So you should edit php.ini template. The actual php.ini will be regenerated from the template everytime you restart MAMP.
The problem is that you are probably hitting a different php install.
Try the following:
If you get anything other than,
/Applications/MAMP/bin/...
, you need update your environment to point to MAMP's installation.To do this, you will need to add the following to .bash_profile (please update the path to match your setup):
Reload .bash_profile with the following command:
After you do this, you should be pointing to the correct php installation. Try
which php
again to confirm. Now runphp -i | grep ini
to confirm that the correctphp.ini
file is being loaded. As Seldaek stated, the relevant lines are: