0
votes

I'm trying to install cakephp using composer with this tutorial but after I run the command:

sudo composer create-project --prefer-dist cakephp/app my_app_name

I get the error:

Problem 1 - cakephp/cakephp-codesniffer 3.0.0 requires squizlabs/php_codesniffer ^3.0.0 -> satisfiable by squizlabs/php_codesniffer[3.0.0, 3.0.1, 3.0.2, 3.1.0, 3.1.1]. - cakephp/cakephp-codesniffer 3.0.1 requires squizlabs/php_codesniffer ^3.0.0 -> satisfiable by squizlabs/php_codesniffer[3.0.0, 3.0.1, 3.0.2, 3.1.0, 3.1.1]. - squizlabs/php_codesniffer 3.1.1 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system. - squizlabs/php_codesniffer 3.1.0 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system. - squizlabs/php_codesniffer 3.0.2 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system. - squizlabs/php_codesniffer 3.0.1 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system. - squizlabs/php_codesniffer 3.0.0 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system. - Installation request for cakephp/cakephp-codesniffer ^3.0 -> satisfiable by cakephp/cakephp-codesniffer[3.0.0, 3.0.1].

To enable extensions, verify that they are enabled in your .ini files: - /etc/php/7.0/cli/php.ini - /etc/php/7.0/cli/conf.d/10-opcache.ini - /etc/php/7.0/cli/conf.d/10-pdo.ini - /etc/php/7.0/cli/conf.d/20-calendar.ini - /etc/php/7.0/cli/conf.d/20-ctype.ini - /etc/php/7.0/cli/conf.d/20-curl.ini - /etc/php/7.0/cli/conf.d/20-exif.ini - /etc/php/7.0/cli/conf.d/20-fileinfo.ini - /etc/php/7.0/cli/conf.d/20-ftp.ini - /etc/php/7.0/cli/conf.d/20-gettext.ini - /etc/php/7.0/cli/conf.d/20-iconv.ini - /etc/php/7.0/cli/conf.d/20-intl.ini - /etc/php/7.0/cli/conf.d/20-json.ini - /etc/php/7.0/cli/conf.d/20-mbstring.ini - /etc/php/7.0/cli/conf.d/20-phar.ini - /etc/php/7.0/cli/conf.d/20-posix.ini - /etc/php/7.0/cli/conf.d/20-readline.ini - /etc/php/7.0/cli/conf.d/20-shmop.ini - /etc/php/7.0/cli/conf.d/20-sockets.ini - /etc/php/7.0/cli/conf.d/20-sysvmsg.ini - /etc/php/7.0/cli/conf.d/20-sysvsem.ini - /etc/php/7.0/cli/conf.d/20-sysvshm.ini - /etc/php/7.0/cli/conf.d/20-tokenizer.ini You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.

I installed codeSniffer using both curl and composer. still I can't get rid of the error. any ideas what I am doing wrong?

4
you don't have one of those extension installed on your web servermadalinivascu
@madalinivascu but I followed the tutorial steps.So shouldn't they be installed? and how can I tell which one?Bahman Rouhani
Read the error message closely, it tells you wich extensions are missing: "squizlabs/php_codesniffer 3.1.1 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system"ndm

4 Answers

0
votes

It looks like codeSniffer requires squizlabs ^3.0.0. And it also looks like you need to enable extensions in your .ini files.

7
votes

I had a similar error at one point. It was fixed by installing php-xml. Make sure you install what waris said also.

sudo apt-get install php-xml
1
votes

You need to install some extension i-e:

sudo pear install PHP_CodeSniffer

And also enable the php extensions for composer i-e curl,intl

sudo apt-get update

sudo apt-get install curl php-cli php-mbstring git unzip

extra options:

to install composer globally :

sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
1
votes

I had a similar error at one point. It was fixed by installing php-xml. Make sure you install what waris said also. first php version

php -v

and

sudo apt-get install <your php version>-xml