So I have just cloned a Contao based project on my Mac, and as I am setting it up i ran ´composer install´, before I updated to macOSX Catalina i never have this issue but now I am getting the following error, any ideas on fixing this? I am lost!
As the error message already says, the PHP intl extension is not enabled for the PHP CLI environment that you used.
If you used the system's PHP and Apache packages, your previous configuration might have been deleted/overridden by the MacOS update. This is known to happen.
I had the same problem and i solve it by reinstalling the command line tools
open your Terminal
write the command below
$ xcode-select --install
so how i solve it
Related
MacOS 12.1 After successfully installing php 8.1 with homebrew (along with apache/mySQL and phpmyadmin) I am trying unsuccessfully to install/link php 7.4. After following instructions to install, unlink, link, php -v returns 7.4 but phpinfo() shows 8.1. What am I doing wrong?
Strange enough, using a full name such as "shivammathur/php/php#8.1" for the link command is what worked for me.
Eg:
brew link --overwrite --force shivammathur/php/php#7.4
Also, don't forget to close your terminal completely and reopen it before checking the version with php -v.
It looks as if I never successfully killed the included MacOS Apache. I uninstalled home-brew and the server was still running (with PHP8.1!). Not sure what went wrong.
I am aware there are many other questions related to this error, but I have tried all the answers and nothing worked.
Full error
dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
Referenced from: /usr/local/opt/php#7.1/bin/php
Reason: image not found
Abort trap: 6
When did the error occur?
Right after updating Ruby to 2.6.3 via RVM.
Whenever I enter "php" into the terminal the error appears.
Steps taken
Basic steps: Restart Macbook, opened new terminal window.
Uninstall/Reinstall: Node, Openssl, libpng, Ruby
Update/Upgrade: brew
Unlinked/Linked: libidn, autoconf
Given myself all rights via chown -R /usr/local
OpenSSL: $ sudo rm /usr/bin/openssl, brew reinstall openssl#1.1
Brew cleanup
Reinstalled PHP
Versions
Mac OS Mojave 10.14.6
PHP 7.4
Ruby 2.6.3p62
RVM 1.29.9
When running Brew Doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
/opt/local/bin/python2.7-config
/opt/local/bin/curl-config
/opt/local/bin/ncursesw6-config
/opt/local/bin/pcre-config
/opt/local/bin/ncurses6-config
/opt/local/bin/pcap-config
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
(here it posts all the /usr/local/include/node files, but the list exceeds character limitations)
Any ideas on how to solve this error?
I had similar issue which I fixed this way:
brew reinstall php
I will answer my own question for others who might run into a similar issue
After having uninstalled and reinstalled every single keg of brew I found the following solution:
Uninstall PHP
Run brew cleanup
Check your /usr/local/opt folder for any folders named php
Delete the folder (in my case it was called 'php#7.1')
Open a new terminal window
Run 'brew search php' in the terminal and make sure no php keg is installed.
Simply type 'php -v' in the terminal. For me this showed a version number, indicating that php was (at one point) installed without brew. You can choose to uninstall this version or update it to the newest version.
Conclusion
In my case I believe it was simply that PHP 7.1 was already installed and I installed a 2nd version (7.4) via brew.
The error 'Referenced from: /usr/local/opt/php#7.1/bin/php' was obviously searching for something in this folder and after deleted it, the error stopped.
In my case, i had multiple version of php installed on my macOs, which was later remedies with laradock.
Primary problem:
❯ php -v
dyld[62395]: Library not loaded: /opt/homebrew/opt/icu4c/lib/libicuio.70.dylib
Referenced from: <31116583-6CB3-3C7B-AD46-52FF1431267E> /opt/homebrew/Cellar/php#7.4/7.4.30/bin/php
Reason: tried: '/opt/homebrew/opt/icu4c/lib/libicuio.70.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/icu4c/lib/libicuio.70.dylib' (no such file), '/opt/homebrew/opt/icu4c/lib/libicuio.70.dylib' (no such file), '/usr/local/lib/libicuio.70.dylib' (no such file), '/usr/lib/libicuio.70.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/icu4c/72.1/lib/libicuio.70.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/icu4c/72.1/lib/libicuio.70.dylib' (no such file), '/opt/homebrew/Cellar/icu4c/72.1/lib/libicuio.70.dylib' (no such file), '/usr/local/lib/libicuio.70.dylib' (no such file), '/usr/lib/libicuio.70.dylib' (no such file, not in dyld cache)
Also tried
❯ brew uninstall php
Warning: Calling plist_options is deprecated! Use service.require_root instead.
Please report this issue to the mongodb/brew tap (not Homebrew/brew or Homebrew/core), or even better, submit a PR to fix it:
/opt/homebrew/Library/Taps/mongodb/homebrew-brew/Formula/mongodb-community.rb:55
As indicated "Referenced from" a php version was still installed after mutliple attempts of brew uninstall php
Solution:
rm -rf /opt/homebrew/etc/php
After above brew install php without a problem.
Hope this helps.
A fresh install of Mac OS and Laravel valet didn't help get rid of the problem. I dug deeper and edited the php.ini files of both PHP 7.2 and 7.3.
edit made on both files was "pecr.jit=1 to pecr.jit=0" still no luck.
I've noticed that the errors appear on querying database. Sequel Pro crashes too when this happens.
this worked for me try it
remove brew and composer
and reinstall them and make these tweaks in php.ini
Errors Installing Composer on macOS (JIT compilation Failed)
i was working on a laravel project then i installed a new package using composer and i found this error
PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); the classname must be a string specifying an existing class
i tried to :-
revert to previous commit on git
remove vendor folder and composer.lock and reinstall
all with no results
Had the same problem here.
Downgrading to composer require doctrine/dbal=2.6.3 did the trick so far.
I had same problem. After downgrading doctrine/dbal 2.7 to 2.6.*, the problem was resolved.
i had the same problem after reinstalling a new OS (ubuntu 16.04), solved by running composer update then composer dump-autoload.
seems to be a problem with caching in composer
I had the same problem and it turn out to be a configuration on Nginx, which was still pointing to the php7.0-fpm after I've upgraded to php 7.2.
I've just fix that on /etc/nginx/sites-available/default
Edit composer.json:
"doctrine/dbal": "2.8." to "doctrine/dbal": "2.4." and run composer update will resolve problems.
I found this question because i had a similar problem.
I upgraded from PHP 7.0 to PHP 7.2 and the problem started.
I knew it had to do with the server not the laravel application.
After search with no luck. I simply restarted my httpd.service and viola! It worked.
I guess this because i didn't restart the http server after the upgrade from PHP 7.0 to 7.2.
So just reboot the server or restart the http service might get this fixed.
I was able to fix this issue by removing php7.0-common package when I've installed both php7.0 and php7.2.
Initially, command-line was using php7.2 (php -v) but when I checked phpinfo in the browser it was using php7.0. That might have caused the problem for me.
Try updating your PHP version to 7 or 7.1
I had noticed that an application I have setup on heroku only shows sessions variables on random requests when I refresh the browser. I put this down to the fact the application is running on 5 dynos.
I followed the following tutorial to solve this with memcached using memcachedcloud.
https://devcenter.heroku.com/articles/php-sessions#storing-sessions-in-memcached
The issue still remains though. I am using the PHP slim framework, is there any further config I need for this? I cant seem to find anything in the slim docs.
EDIT:
I can not produce the required composer.lock file because when running.
composer update
I get the error
The requested PHP extension ext-memcached * is missing from your system.
But it is in fact installed. I can see the version from typing.
memcached -h
But it is not present when typing
composer show --platform
Depending on what platform you're running, you have to make sure you that composer updates. Even if you have memcached installed, it has to match your PHP version. Then, once installed, run composer update
For example:
If you have PHP5.6.15, get memcached with, either, brew install php56/memcached or sudo apt-get install php56/memcached.
Then run composer update.
If you have an issue installing composer on Mac, you have to enable rootless install. More info can be found here:
https://donatstudios.com/OS-X-Mavericks-Memcached-PHP-Extension-Installation
The gist of the steps to take are:
Restart computer and hold Command + R to get into recover mode
Get into the terminal from Utilities
Run csrutil disable and restart
This should be done prior to installing memcached from Homebrew.
Hope this helps.
I had a similar issue, where I was getting the same "ext-memcached * is missing" error and could not see ext-memcached when running composer show --platform.
I noticed that when I originally installed memcached, homebrew showed me various alternatives. So on Mac OSX El Capitan, I ended up installing the one that matched my PHP version:
brew install homebrew/php/php55-memcached
And then I had to add it to php.ini:
extension=/usr/local/Cellar/php55-memcached/2.2.0/memcached.so
You can get the correct version path with:
brew info php55-memcached
And then I restarted Apache:
sudo apachectl restart
It finally showed up in the composer list and I was able to update composer without error.