I want to install phpdocumentor to my Symfony 2.4 project, so I added this two lines to my composer.json:
"require": {
//my old requires
"phpdocumentor/template-abstract": "~1.2",
"phpdocumentor/phpdocumentor": "2.1.*#dev"
}
whene I execut php composer.phar update, i have these errors:
Problem 1
- phpdocumentor/template-abstract 1.2.1 requires ext-xsl * -> the requested PHP extension xsl is missing from your system.
- phpdocumentor/template-abstract 1.2 requires ext-xsl * -> the requested PHP extension xsl is missing from your system.
- Installation request for phpdocumentor/template-abstract ~1.2 -> satisfiable by phpdocumentor/template-abstract[1.2, 1.2.1].
although I installed php_xsl in my php extensions?!!
Thank you.
Ok I just answered this here.. might as well elucidate.
Basically you also need to enable the extension in the php.ini file used by PHP CLI as this is the one composer uses when you run it on the command line.
( Mine is at: C:\wamp\bin\php\php5.4.12\php.ini )
Good Luck.
#Mohamed: I was getting the same problem few days back but when I tried the following command it then worked successfully.This will update your composer.phar file.
php composer.phar self-update
Related
I'm building a website with PHP framework "Slim" as my templating framework, and it recommends using composer as the package manager. SO... I'm now using composer for the first time, developing locally on 64 bit Ubuntu 16.04 and composer is not installing anything into my project.
I've followed the installation instructions on the Slim Framework & Composer websites to a tee.
Basically this is the order of what I've done:
Installed composer into /var/www/html directory [1.]
Created Slim project using Slim-Skeleton as a base
php composer.phar create-project slim/slim-skeleton slimLittleTest
Note: the php composer.phar create-project slim/slim-skeleton command automatically creates a composer.json file, I will put the contents of that file down farther in my question.
Change into that directory and run php composer.phar install
Nothing is installed!
If I try to run php -S localhost:8080 -t public public/index.php as you're now supposed to able to (from the Slim framework website homepage tutorial) I get the following error:
[Tue Sep 5 18:55:04 2017] PHP Fatal error: require(): Failed opening required '/var/www/html/slimLittleTest/public/../vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/html/slimLittleTest/public/index.php on line 12
[Tue Sep 5 18:55:05 2017] PHP Warning:
require(/var/www/html/slimLittleTest/public/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/slimLittleTest/public/index.php on line 12
This error of course makes sense because nothing got installed! There is no vendor/autoload.php because Composer hasn't installed anything. (By default Composer installs dependencies into the vendor folder in the root of your project)
SEPTEMBER 7th QUESTION UPDATE
From some comments down below, I've been alerted to the fact that something must have gone wrong on the command composer create-project, that my solution of just re-requiring all packages shouldn't be necessary. Upon further inspection, I did get some errors upon running command php composer.phar create-project slim/slim-skeleton projectName. Below is exactly what got output from the console after running that command:
php composer.phar create-project slim/slim-skeleton tester
Installing slim/slim-skeleton (3.1.2)
- Installing slim/slim-skeleton (3.1.2): Loading from cache
Created project in tester
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
- phpunit/phpunit 5.7.9 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 5.7.7 requires ext-dom * -> the requested PHP extension dom is missing from your system.
[.......]
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-mysqlnd.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-imagick.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-mcrypt.ini
- /etc/php/7.0/cli/conf.d/20-mysqli.ini
- /etc/php/7.0/cli/conf.d/20-pdo_mysql.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.
Would either that .ini extensions issue or Problem 1 php unit requires ext-dom issue be the main source of my problem?
I got lucky and stumbled upon an answer that worked in my situation.
I just had to run php composer.phar require [package_name], for each package name, and if it wasn't in composer.json yet that dependency would get installed. So what I needed to do was delete the composer.json file, then go back and require each package from it. Nothing else worked, such as php composer.phar update, or php composer.phar install.
So I ran php composer.phar require slim/php, php composer.phar require php, etc. from the command line and everything installed correctly.
This is potentially a failure of the getting started documentation from SlimFramework.com, It's not necessarily "wrong" because maybe it works in some/most situations, but they should at least address the potential for the problem I ran into, and a solution or way to avoid it.
EVEN BETTER SOLUTION
Turns out that the main error I was getting here is that I was missing ext-dom. Thank you to this badass #Anar Bayramov's answer on another StackOverflow question I know that I can get the missing ext-dom by simply downloading php7.0-xml.
sudo apt-get update
sudo apt-get install php7.0-xml
And BOOM! Now when I run php composer.phar create-project slim/slim-skeleton projectName all vendor packages are installed successfully and it works like a charm. Problem solved.
I have an annoying error that doesn't let me do any composer install or server:start or cache:clear
I don't understand the error
[Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
You have requested a non-existent parameter "base_cdn".
and so it can't let me do anything.
And I have many other issues such as:
Problem 1
- Installation request for gregwar/image v2.0.20 -> satisfiable by gregwar/image[v2.0.20].
- gregwar/image v2.0.20 requires ext-gd * -> the requested PHP extension gd is missing from your system.
Problem 2
- Installation request for gregwar/image-bundle v2.1.3 -> satisfiable by gregwar/image-bundle[v2.1.3].
- gregwar/image-bundle v2.1.3 requires ext-gd * -> the requested PHP extension gd is missing from your system.
I can't make a composer update as in the project it is forbidden to do (as good practice) but I only can make composer install.
So anyway, I'm lost. Anyone got an idea on this error?
You have requested a non-existent parameter "base_cdn".
This means you are using somewhere in your code a base_cdn parameter. You can search it in your project, it will be used surrounded by percent sign - %base_cdn%. So, you are using it somewhere but it's not defined anywhere, so all you need to do is to add base_cdn parameter to your parameters.yml file (in fact you should also add it to your parameters.yml.dist file as well)
EDIT: If you have it in your parameters.yml.dist already then most probably composer will ask you for base_cdn value after successfull composer install which currently can't be performed because of the gd issue. If, for some reason, composer will not ask for a value after composer install then just copy line with base_cdn from parameters.yml.dist to parameters.yml. Since parameters.yml is not stored in version control (or at least should not be stored) all your teammates will have to type in this value after composer install
gregwar/image v2.0.20 requires ext-gd * -> the requested PHP extension gd is missing from your system.
This means you are misssing gd php extension. To install it you will need to do something like apt-get install php-gd depending on what system you are working on.
I have trouble installing devisephp for laravel. I am working on the latest version of homestead with php7. when i do composer update i get the following error.
Problem 1
- Installation request for devisephp/cms 1.4.* -> satisfiable by devisephp/cms[1.4.0].
- devisephp/cms 1.4.0 requires ext-imagick * -> the requested PHP extension imagick is missing from your system.
After having this message i installed imagick on my homestead environment added the extension to php.ini in cli and fpm and checked in homestead if imagick is working with a test file. Everything was working perfectly but on running composer update i still get the same error message from above. Does anyone have a clue what the problem can be.
The stange thing is that is kan git clone devisephp its bootstrap version completely working including image handling but when i add another package to laravel i again get the above message.
if you really can't install or don't want that extension to be validated you may skip it by supplying the
--ignore-platform-reqs
flag to your composer command
Please follow these steps
sudo apt-get install php-imagick
php -m | grep imagick // this should print 'imagick' it means installed correctly
sudo service apache2 restart //(if needed)
Try adding:
"ext-imagick": "*",
to your require block in your composer.json like so:
"license": "MIT",
"require": {
"ext-imagick": "*",
....
}
and run composer update
With the config.platform key in composer.js you can fake dependencies like php versions or extensions (you can't use an asterisk for the extension version, though!)
https://getcomposer.org/doc/06-config.md#platform
As a bonus, you can polyfill ext-imagick with this library: https://github.com/calcinai/php-imagick. it's not complete and relies on the command line ImageMagick. So far it works for me.
{
"require": {
"calcinai/php-imagick": "dev-master"
},
"config": {
"platform":{
"ext-imagick": "3.4.4"
}
}
}
I downloaded a website developed on laravel4 on my system and runing it on my localhost . Some of the pages are not working .
When I am trying to upload an Image . following error is occurring.
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)
HELP
Class 'Image' not found
So I googled and got to know that I will have to add the intervention/image in my coomposer.json file i changed the code of json array from
"require": {
"laravel/framework": "4.2.*",
"intervention/image": "1*"
},
to
"require": {
"laravel/framework": "4.2.*",
"intervention/image": ""2.3.0""
},
Then I did composer update and I am getting following error
Any leads ??
C:\Users\User\Desktop\ideconnect>composer update
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
- Installation request for intervention/image 2.3.0 -> satisfiable by interv
ention/image[2.3.0].
- intervention/image 2.3.0 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.
Thanks
The error you're getting is fairly clear:
the requested PHP extension fileinfo is missing from your system.
This means that the package you are trying to install relies on a PHP extension that your specific PHP installation does not have. This is fixable, but might be specific to your environment.
The first thing to do would be to check your php.ini and see if the extension is simply commented out. If you are using Windows, it might look like this inside php.ini:
;extension=php_fileinfo.dll
you should uncomment it like so:
extension=php_fileinfo.dll
After doing this you will need to restart your webserver.
If that doesn't work, you will need to look for more info in the PHP manual: http://php.net/manual/en/fileinfo.installation.php
I'm trying to create thumbnails with Avalanche-imagine bundle. I'm using OS X 10.7 Lion and MAMP PRO as Apache server.
When I call the filter in the twig file, I get a 500 error.
Here I put the path manually to check it:
<img src='{{'store/images/Pictures/P1000665.JPG' | apply_filter('my_thumb')}}'>
And I get this message:
GET
http://taller:8888/web/app_dev.php/media/cache/my_thumb/store/images/Pictures/P1000665.JPG 500
(Internal Server Error)
line 35, it's strange because my thumbnails are used far behind
I installed the bundle following this instructions: https://github.com/avalanche123/AvalancheImagineBundle
I have to say that I had several problems installing it because composer.phar gave me an error message:
"Problem 1
- symfony/icu v1.2.0 requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- symfony/icu v1.2.0 requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- Installation request for symfony/icu 1.2.* -> satisfiable by symfony/icu[v1.2.0]."
I solved it adding this line in the composer.json requirements:
"symfony/icu": "1.0.*",
Once installed, I could install the AvalancheImageBundle with the composer.
Then I changed AppKernel as they said in the instruction with this line:
new Avalanche\Bundle\ImagineBundle\AvalancheImagineBundle(),
but I didn't change the autoload file, as I had to do when I installed FOSUserBundle. Do I have to add anything there?
I tried with this, but it didn't solved my problem:
$loader->add('imagine', __DIR__.'/../vendor/imagine/imagine/lib');
$loader->add('Avalanche123', __DIR__.'/../vendor'):
Additional info:
My proyect is in: Symfony2/proyecto/taller/here_are_web_app_vendor_and_src
My apache server aim to: Symfony2/proyecto/taller using the sortcut taller instead of localhost my url is like this:
http://taller:8888/web/app_dev.php/
My pictures are in the url: Symfony2/proyecto/taller/web/store/images/Pictures/test.jpg
witch url should I give to the filter? I think it is store/images/Pictures/test.jpg
The problem could be in the dependences of the bundle, because I put that line the composer.json?
Maybe should I write something in the autoload file? Any reference to vendor/imagine miss?
Also I tried to install liipImagine bundle, but I couldn't because it said that I had installed imagine 0.3.0 and I needed imagine 0.4.0. How can I uninstall imagine and install the new version to run liipimaginebudle?
appKernel:
As you can see, no references to imagine (I guess its integer in Avalanchebundle)
autoload:
(no references to avalanche?)
Here is where my pictures are located and you can see how Avalanche created the media folder:
This is my vendor file:
I don't know where is the problem, this is why I put so many information.
I solved the problem using LiipImagineBundle.
To install it first I deleted Avalanche reference in composer.json and everything else I wrote in appKernel.php, etc.
Then I did composer.phar update and it deleted also imagine/imagine 0.3.0 vendor library. Finally I installed LiipImagine via composer normally that installed a newer version of imagine/imagine, 0.4.0.