I am trying to install mpdf using composer, but when I try command_prompt "composer require mpdf/mpdf" in my project folder, I get version 6.1 installed instead of 7.x. Any suggestions?
Windows 11
XAMPP v3.3.0
Any help appreciated!
command prompt screen shot
This can work like this because of php version installed locally. latest version of mpdf or its dependencies can require the specific version of php or its extensions or smth else. If you're not going to run your code locally, you can cpecify target php and exts versions int you composer.json like this:
{
"require": {
"php": "~7.4.0",
"ext-gd": "*",
"ext-mbstring": "*"
}
}
You may not get the latest lib version but you will get version that will work on your target system
Related
I have this file directory:
When I open this project in browser: Fatal error: Class 'Phalcon\Mvc\Application' not found in...
I read that I have to install composer but when I install composer this errors occure:
How can I run my project?
My composer.json file consists:
"require": {
"phalcon/incubator-mailer": "^1.0",
"smi2/phpclickhouse": "^1.4",
"hybridauth/hybridauth": "^3.8"
}
}```
There are in fact two problems.
You are missing the phalcon php extension. You can find the instructions on how to install the extension in the official Phalcon documentation.
You need at least php version 7.3 to satisfy the requirements of smi2/phpclickhouse. Since php 7.x is EOL since 26th of November 2022, I'd strongly suggest to upgrade to the latest version which currently is php 8.1.
Once you resolved the two problems, composer install should run successfully, and the missing classes should be placed in the vendor directory.
Following up on some of the other comments, Phalcon 4 is NOT compatible with PHP 8.1. Phalcon 4 requires PHP 7.4.
If you plan on running PHP 8.1, you will need to install Phalcon 5.1.1.
You can find the Phalcon installation documentation on at https://phalcon.io
I am running my Laravel 8 app using free plan in Heroku.
However, the issue was I'm getting prompted with an error of:
Class 'NumberFormatter' not found
Upon searching I have read a solution to install php intl extension. Can I have a guide on how exactly would I do this ? Thank you so much.
I have explicitly enabled the extension via composer.json like so:
(Note: use "*" as the version selector.)
{
"require": {
"ext-intl": "*",
}
}
then run composer update.
Uncomment this in php.ini
extension=ext/php_intl.dll
Or (Ubuntu 20.04):
apt-get install php7.0-intl
I am trying to require "ext-SimpleXML": "^7.1" in my composer.json and I am using travis as my testing framework. Locally everything works fine but on travis (when using composer install) I always get the error message:
The requested PHP extension ext-simplexml ^7.1 has the wrong version (0.1) installed. Install or enable PHP's simplexml extension.
Does anyone know how I can update or tell travis to install/use the correct version? I already tried it with sudo apt-get install php-xml without success.
Try use the line below.
"ext-SimpleXML": "*"
https://getcomposer.org/doc/01-basic-usage.md#platform-packages
Most of PHP extensions do not have own versions. They are fixed to a specific PHP build. Few are a thin shims to system libraries and the shims versions are meaningless.
I've been having issues with my webapp ever since heroku upgraded to PHP 7.2.0. How can I downgrade to a 7.0.* version of PHP on heroku?
Heroku currently supports PHP 5.6, 7.0, 7.1 and 7.2.
You can select your runtime in your composer.json file, e.g.
{
"require": {
"php": "^7.0"
}
}
to select the latest version of PHP 7.0.
A little gotcha, make sure you commit in the composer.lock file after setting the php version in your composer.json:
composer update
I have a Symfony 3.0 application that I want to deploy on cloudControl. The app is running on the pinky stack; my composer.json requires PHP >=5.5.9
"require": {
"php": ">=5.5.9",
...
}
When I try to push, I get
...
-----> WARN: No php version found in composer.json. Falling back to legacy build.
...
Your requirements could not be resolved to an installable set of packages.
Problem 1
- This package requires php >=5.5.9 but your PHP version (5.4.45) does
not satisfy that requirement.
The phpinfo() of the pinky stack shows, that PHP 5.6.12 is running.
How do I have to modify my composer.json (or any other file in my application) to make this run in PHP 5.6?
There is a blog post, about how to use specific PHP versions and extensions.
http://www.paasfinder.com/custom-php-version/
Since all systems are 64bit, you have to use e.g.:
{
"require": {
"php-64bit": "5.6.12"
}
}