Am trying to download cakephp using the following code frome the terminal - php composer.phar create-project --prefer-dist cakephp/app bookmarker
but it tells me am missing some extensions in my system -
Problem 1
- cakephp/cakephp 3.2.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.2.1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.2.0-RC1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
Any suggestions please.
- cakephp/cakephp 3.2.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- Installation request for cakephp/cakephp ~3.2 -> satisfiable by cakephp/cakephp[3.2.0, 3.2.0-RC1, 3.2.1, 3.2.x-dev].
You have to enable intl extension from php.ini
if you use xampp see this
Otherwise find php.ini
search intl.dll
remove semiclone infront of it (for xampp)
remove # (for wampp)
Save it and restart server
After this process try to download again
I run into the same problem while installing CakePHP for a new project. What I did was the following:
1) Upgrade the PHP to 5.6 (http://coolestguidesontheplanet.com/upgrade-php-on-osx) and check my phpinfo() file for intl to be enabled. As it was enabled I thought that the default Mac OS PHP in use was not the one I was checking in phpinfo(). Indeed when prompting on the terminal php -v or which php I realised the CLI was using PHP 5.5.3 so I modified my ~/.profile and ~/.bash_profile...
2)vim ~/.profile
#export PATH=/opt/local/bin:/opt/local/sbin:$PATH
PATH=/usr/local/php5/bin:$PATH
3) source ~/.profile
4) vim ~/.bash_profile
#export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export PATH=/usr/local/php5/bin:$PATH
5) Close and reopen the terminal.
6) Check again php -v or which php and PHP 5.6 appeared.
7) Run again php composer.phar create-project --prefer-dist cakephp/app app_name and the error was gone.
It turns out that some months ago I had installed homebrew and with it another PHP version got installed as the default Mac OS PHP with no intl enabled.
Related
I have a laravel project and I tried to run phpunit to give me a coverage report. I ran the command vendor/bin/phpunit --coverage-html storage/test-output-data/coverage-html and it gave the output:
PHPUnit 8.5.8 by Sebastian Bergmann and contributors.
Error: No code coverage driver is available
I tried to resolve this situation by doing a sudo pecl install pcov, but running the phpunit still gave the same error above.
I noticed that I have the file /usr/lib/php/20170718/pcov.so. So I added the line extension=/usr/lib/php/20170718/pcov.so to my /etc/php/7.4/cli/php.ini file. But when I type php -v, I get this error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20170718/pcov.so' (tried: /usr/lib/php/20170718/pcov.so (/usr/lib/php/20170718/pcov.so: undefined symbol: _zval_ptr_dtor), /usr/lib/php/20190902//usr/lib/php/20170718/pcov.so.so (/usr/lib/php/20190902//usr/lib/php/20170718/pcov.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.4.11 (cli) (built: Oct 10 2020 19:44:50) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.11, Copyright (c), by Zend Technologies
I also have a folder called /usr/lib/php/20190902 but it does not have a pcov.so file.
I also tried doing a sudo pecl install xdebug, but I run into similar errors as above where phpunit says there's no driver and typing php -v says some global variable is missing similar to the pcov issue.
What am I doing wrong?
I noticed that I have the file /usr/lib/php/20170718/pcov.so. So I added the line extension=/usr/lib/php/20170718/pcov.so to my /etc/php/7.4/cli/php.ini file.
This file is for PHP 7.2 (based on 20170718 part) while you are trying to use it in PHP 7.4.
You need to get the right version of Xdebug (or PCOV) for your PHP 7.4. (NOTE: for PHP 7.4 the API version (and the right folder in the path) will be 20190902.)
Try this solution from the following answer to switch / install extensions via PECL for specific PHP version (7.4 instead of your current 7.2): https://stackoverflow.com/a/54594604/783119
sudo pecl -d php_suffix=7.4 install <package-name>
This has nothing to do with PHPUnit. You have a problem with your PHP environment: "PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20170718/pcov.so' (tried: /usr/lib/php/20170718/pcov.so (/usr/lib/php/20170718/pcov.so: undefined symbol: _zval_ptr_dtor), /usr/lib/php/20190902//usr/lib/php/20170718/pcov.so.so (/usr/lib/php/20190902//usr/lib/php/20170718/pcov.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0"
You just need to install xdebug, so the coverage knows how to run.
For example, for PHP 7.1, it's this package:
sudo apt install php7.1-xdebug
Just fixed it today for my scenario. In your case, just change the PHP version to:
sudo apt install php7.4-xdebug
When I try to install CakePHP, I get an error that intl is missing:
$ composer self-update && composer create-project --prefer-dist cakephp/app blog
You are already using composer version 1.5.2 (stable channel).
Installing cakephp/app (3.5.0)
- Installing cakephp/app (3.5.0): Loading from cache
Created project in blog
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- cakephp/cakephp 3.5.5 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.5.4 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.5.3 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.5.2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.5.1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.5.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- Installation request for cakephp/cakephp 3.5.* -> satisfiable by cakephp/cakephp[3.5.0, 3.5.1, 3.5.2, 3.5.3, 3.5.4, 3.5.5].
When I try to install php56-intl, I get a message that it's already installed:
$ brew install php56-intl
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, homebrew/php).
==> New Formulae
bchunk dps8m e2tools heartbeat kaitai-struct-compiler simg2img
==> Updated Formulae
abcmidi debianutils getdns homebrew/php/php55-molten inspircd mdds ompl scalaenv terragrunt
asciidoc dssim geth homebrew/php/php56-molten itstool mikutter ortp scalastyle tintin
bazel erlang gofabric8 homebrew/php/php70-molten kerl mupdf pandoc scm-manager vapoursynth
bit exploitdb grafana homebrew/php/php71-molten libgsf mupdf-tools poco sjk wireguard-tools
cmake faas-cli grakn i2p libmaxminddb mypy poppler sourcekitten yara
convox firebase-cli gsmartcontrol imagemagick libpqxx nativefier prometheus swiftformat
cppad gegl homebrew/php/php54-molten imagemagick#6 libuv node-build resty swiftlint
==> Renamed Formulae
newsbeuter -> newsboat
Warning: homebrew/php/php56-intl 5.6.32_10 is already installed
Why is this happening? What can I do to fix it?
Edit: I'm on Mac OS X. Running which php returns PHP 5.6.28 ...
This question already has answers here:
CakePHP 3.0 installation: intl extension missing from system
(17 answers)
Closed 5 years ago.
I have installed cakephp using composer.
But while running it showing the following error.
Warning: require(D:\xampp\htdocs\my_app_name/vendor/autoload.php): failed to open stream: No such file or directory in D:\xampp\htdocs\my_app_name\webroot\index.php on line 27
Fatal error: require(): Failed opening required 'D:\xampp\htdocs\my_app_name/vendor/autoload.php' (include_path='D:\xampp\php\PEAR') in D:\xampp\htdocs\my_app_name\webroot\index.php on line 27
Could you please help me ?
Lenovo-User#Lenovo MINGW64 /d/xampp/htdocs
$ composer self-update
You are already using composer version 1.4.2 (stable channel).
Lenovo-User#Lenovo MINGW64 /d/xampp/htdocs
$ composer create-project --prefer-dist cakephp/app mylogin
Installing cakephp/app (3.4.2)
- Installing cakephp/app (3.4.2): Loading from cache
Created project in mylogin
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- cakephp/cakephp 3.4.9 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
- cakephp/cakephp 3.4.8 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
- cakephp/cakephp 3.4.7 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
- cakephp/cakephp 3.4.6 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
- cakephp/cakephp 3.4.5 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
- cakephp/cakephp 3.4.4 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
- cakephp/cakephp 3.4.3 requires ext-intl * -> the requested PHP extension i
ntl is missing from your system.
- cakephp/cakephp 3.4.2 requires lib-icu >=4.8 -> the requested linked libra
ry icu has the wrong version installed or is missing from your system, make sure
to have the extension providing it.
- cakephp/cakephp 3.4.1 requires lib-icu >=4.8 -> the requested linked libra
ry icu has the wrong version installed or is missing from your system, make sure
to have the extension providing it.
- cakephp/cakephp 3.4.0 requires lib-icu >=4.8 -> the requested linked libra
ry icu has the wrong version installed or is missing from your system, make sure
to have the extension providing it.
- Installation request for cakephp/cakephp 3.4.* -> satisfiable by cakephp/c
akephp[3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 3.4.5, 3.4.6, 3.4.7, 3.4.8, 3.4.9].
To enable extensions, verify that they are enabled in your .ini files:
- D:\xampp\php\php.ini
You can also run `php --ini` inside terminal to see which files are used by PH
P in CLI mode.
Lenovo-User#Lenovo MINGW64 /d/xampp/htdocs
$
Thanks,
Run following command first (you might need to prepend this with sudo if composer was installed globally)
composer self-update
then again
composer create-project --prefer-dist cakephp/app my_app_name
I'm trying to get xdebug working on PHP 7. I'm build the xdebug.so file from version http://xdebug.org/files/xdebug-2.4.0rc4.tgz. The phpize output looks correct (Zend Extension Api No: 320151012) however I get Xdebug requires Zend Engine API version 220121212. from PHP.
So I've followed these instructions:
Tailored Installation Instructions
Summary
Xdebug installed: no Server API: Apache 2.0 Handler Windows: no Zend
Server: no PHP Version: 7.0.9-1 Zend API nr: 320151012 PHP API nr:
20151012 Debug Build: no Thread Safe Build: no Configuration File
Path: /etc/php/7.0/apache2 Configuration File:
/etc/php/7.0/apache2/php.ini Extensions directory:
/usr/lib/php/20151012 Instructions
Download xdebug-2.4.1.tgz Unpack the downloaded file with tar -xvzf
xdebug-2.4.1.tgz Run: cd xdebug-2.4.1 Run: phpize (See the FAQ if you
don't have phpize.
As part of its output it should show:
Configuring for: ... Zend Module Api No: 20151012 Zend Extension
Api No: 320151012 If it does not, you are using the wrong phpize.
Please follow this FAQ entry and skip the next step.
Run: ./configure Run: make Run: cp modules/xdebug.so
/usr/lib/php/20151012 Edit /etc/php/7.0/apache2/php.ini and add the
line zend_extension = /usr/lib/php/20151012/xdebug.so Restart the
webserver
With the exception that I've installed php7.0-dev instead of php5 apt-get install -y php7.0-dev.
When I run the phpize command I get the following output:
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
As expected. However when I run PHP I get:
Xdebug requires Zend Engine API version 220121212.
The Zend Engine API version 320151012 which is installed, is newer.
Contact Derick Rethans at http://xdebug.org/docs/faq#api for a later
version of Xdebug.
I'm obviously doing something wrong somewhere! Any help on debugging the issue is very appreciated! :)
So I fixed this by using the apt-get package:
apt-get install -y php-xdebug
This seems to install the correct xdebug.so file and everything is working!
[root#skadi:/var/www/mailinglist]$ composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for cakephp/cakephp 3.0.*-dev -> satisfiable by cakephp/cakephp[3.0.x-dev].
- cakephp/cakephp 3.0.x-dev requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
Problem 2
- cakephp/cakephp 3.0.x-dev requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- cakephp/debug_kit 3.0.x-dev requires cakephp/cakephp 3.0.*-dev -> satisfiable by cakephp/cakephp[3.0.x-dev].
- Installation request for cakephp/debug_kit 3.0.*-dev -> satisfiable by cakephp/debug_kit[3.0.x-dev].
Try this
sudo apt-get install mcrypt php5-mcrypt
sudo php5enmod mcrypt
on Ubuntu 13.10 and later there is a problem for migration of php modules configuration from /etc/php5/conf.d to /etc/php5/mods-available
If you don't solve verify the mcrypt library
updatedb
locate mcrypt.so
locate mcrypt.ini
Just for the record, as I didn't find a solution anywhere for Arch Linux: If you happen to use composer from the extra repository (extra/php-composer), it's actually not enough to enable the mcrypt extension in /etc/php/php.ini because the global composer script uses its own ini-file (/usr/share/php-composer/php.ini).
To fix the mcrypt error, you can either:
Enable mcrypt extension globally and run composer using php /usr/bin/composer.
Add mcrypt extension to /usr/share/php-composer/php.ini and prevent pacman from overwriting your changes by adding NoUpgrade = usr/share/php-composer/php.ini to /etc/pacman/pacman.conf.
I had this problem when I tried to install laravel with composer on my MAC Yosemite.
This was the error message I got from the terminal:
laravel/framework v5.0.16 requires ext-mcrypt * -> the requested PHP
extension mcrypt is missing from your system.
I followed these instructions to install mcrypt on my MAC:
http://coolestguidesontheplanet.com/install-mcrypt-php-mac-osx-10-10-yosemite-development-server/
And that fixed the problem
Composer was blocking my install of cakephp because of a dependency on mcrypt, despite the fact that mcrypt was installed and working in my php configuration.
I finally realized that Composer was checking the cli mode of php, and I resolved the dependency by simply copying mcrypt.ini from /etc/php5/conf.d to /etc/php5/cli/conf.d.