Hello after I installed Laravel,
I try to update the version 5.5 to 5.6 and unable to throws me an error:
- laravel/framework v5.6.9 requires php ^7.1.3 -> your PHP version (7.0.10) does not satisfy that requirement.
I use XAMPP with PHP 7.2.10.
I installed Composer with php 7 And does not help.
Thanks
Have a look at your composer.json. It is possible that there is a configuration parameter config.platform.php which contains the value 7.0.10. This feature allows to simulate a specific PHP version to composer. If you don't need it, you can remove it or force composer to install anyway by using the --ignore-platform-reqs parameter when updating the packages.
If you are on Linux Debian, you can easily install the latest version of php with sudo apt-get install php x.x. On windows, this link might help. Then, try installing or upgrading Laravel from cmd and it should work sweet! Re-installing the latest verion of XAMPP may also do the work for you.
You have to update your system's PATH environment variable so that it finds the newer version of php from your command line. You might have more than one installed right now, so it uses the first one it finds when it looks through the directories defined in your PATH. After updating the path variable, you might have to log out for it to apply.
You can check the version used by your command line with php --version. To see which version Apache is configured with, use phpinfo().
Related
I am trying to make an import excel data to mysql using php and trying to install composer require phpoffice/phpspreadsheet
but the error below always appear.
Installation failed, deleting ./composer.json.
In RequireCommand.php line 217:
No composer.json present in the current directory (./composer.json), this may be the cause of the following exception.
In PackageDiscoveryTrait.php line 313:
Package phpoffice/phpspreadsheet has requirements incompatible with your PHP version, PHP extensions and Composer version:
- phpoffice/phpspreadsheet 1.25.2 requires ext-zip * but it is not present.
At First, I thought i was because of my php version. I am running xampp with php 7.3 on my macOs. it didnt work.
I try to install it in my windows PC which run php 7.4 and it work just fine.
So I remove my 7.3 version and install the 7.4 version into my mac. and it didnt work either.
There is no compomposer.json in the directory.
When starting a new project, you should at first run
composer init
It will do some question to initialize the value in composer.json, which basically are the same you can pass as parameter to the command: https://getcomposer.org/doc/03-cli.md#init
After that you can run composer to install package
avoid using same name in folder and before installation use composer init
I can't install Magento 2 on Server https://prnt.sc/tqrb6n
By trying to do command composer install. Maybe some one how. How to fix this issue.
[root#junisoft junisoft.ru]# composer instal
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- This package requires php ~7.3.0||~7.4.0 but your PHP version (7.1.28) does not satisfy that requirement.
Problem 2
- Installation request for magento/composer 1.6.0 -> satisfiable by magento/composer[1.6.0].
- magento/composer 1.6.0 requires php ~7.3.0||~7.4.0 -> your PHP version (7.1.28) does not satisfy that requirement.
It seems that problem is with your current php version. it would require your php7.3 version to install magento
You can verify that your current php version by below command.
php -v
it will display the current PHP version.
You can change command-line PHP version by below command
update-alternatives --config php
in your case to resolve above error change it to php7.3 if require you can prefix the command with the sudo access rights.
for webversion php change you can run
a2enmod php7.*
replace 7.* with the version you required and after that restart apache or ngix services
incase of apache 2 you can run below command also
/etc/init.d/apache2 restart
if require sudo privilege you can run the command with the sudo access.
Note: For some server related operation please make sure to run this command with some knowledge or you can also ask server admin help to configure the same.
Try with the below way,
Use --ignore-platform-reqs
for example :- composer install --ignore-platform-reqs
it's will ignore platform requirement problem like php version and etc etc.
Thanks.
Your installed PHP version 7.1.* is not compatible with the Magento 2 version you are trying to install. The Magento 2 version that you want to install is looking for PHP 7.3.* or PHP 7.4.* which is not there on the server.
The very first line of the error statement clearly says that your PHP version is not compatible with the Magento 2 version you are trying to install.
You need to contact your Hosting service provider to update your PHP to the required version which is PHP7.3.* or PHP7.4.*. Only after updating your PHP, you will be able to install the Magento 2 version which is mentioned in your composer.json file.
I found one similar article here https://technicallysound.in/magento-2-upgrade-and-composer-issues/. This explains about composer incompatibility issue with the extensions you are trying to install via Composer.
Lately l've been working with Laravel. I use composer to install packages and artisan for commands.
The problem is that my machine uses Laravel 5.4 not 5.7.
When i run phpinfo() the result is PHP Version 7.2.7. Do you think that the problem is that i don't use the latest version of xampp which it has included php 7?
Based on comment, yes it is related to PHP version. Your PHP CLI version is too low to support newer version of laravel. You need to update or switch PHP CLI to newer version. Server and CLI PHP are separate packages and might have different versions.
No it is not related to PHP version (in this case).
Probably you ran
composer install
which will install dependencies in versions defined in composer.lock to update dependencies run
composer update
For differences between install and update you can refer to this question
From the comments:
laravel/framework v5.5.9 requires php >=7.0 -> your PHP version (5.6.19) does not satisfy that requirement.
Run php -i in the Terminal. Looks like your webserver and your command line (which Composer uses) are using different versions of PHP.
Laravel version depends on your installation way. It's not related to your PHP or XAMPP version. And you are using the latest PHP version, so don't worry about PHP version.
Read the Laravel installation to install the latest version of laravel.
If you using package laravel/installer
Update this package
composer global update
and try to run
laravel new my-app
This question already has answers here:
Tell Composer to use Different PHP Version
(26 answers)
Closed 1 year ago.
I have composer installed on windows 8.1. I use it to download drupal distributions and modules. I have also installed acquia dev desktop. As you know that dev desktop comes with different versions of php and it has separate folders for it. I have setup composer to use php 5.6. How can I make it use php 7?
Should I uninstall composer and install again or what?
IF you have multiple php version installed in your system
you can run composer with different versions like
In linux
PHP
usr/local/php usr/bin/composer install
for PHP 7.1
usr/local/php7.1 /usr/local/composer install
actually the idea is which version you wants to run get its bin path and then run the composer.
In Windows.
path/to/php.exe composer install
Hope this helps
If you just want to ignore the php version dependency then you can use this -
--ignore-platform-reqs
Example:
composer require symfony/css-selector --ignore-platform-reqs
This way you don't have to edit Environment variables(windows os) or using any full path of php etc. This very useful when I use different php lib from github which requires different php version set in my windows Environment variables though I have all PHP versions in my WAMP server so it will not be any problem running those lib after installing.
In my case worked with this:
ea-php72 /opt/cpanel/composer/bin/composer update
I want to upgrade to PHP 5.4.0 in XAMPP. I'm using windows operating system. I searched on web, but there was no proper guide for this as it was released recently.
Can anyone give me some instructions on how to upgrade to PHP 5.4.0 in XAMPP (windows)?
Download the latest binary version of PHP (make sure to get the .zip package not the installer)
De-archive it to a directory
Copy the contents of the directory in the php subfolder of your XAMPP installation directory, overwriting the files which are already present
Overwrite the files which are already present in the apache\bin directory with the newer versions.
Now the trick: take the files which have a "_2" in their names (for example php5apache2_2.dll or php5apache2_2_filter.dll), copy them in the apache\bin subdirectory and remove the "_2" part, overwriting the existing files. This is necessary because by XAMPP uses Apache version 2.2 and the files with the 2 prefix are built for Apache 2.0, so you must take the files build for the newer version (which has a different plugin interface) and rename them in the filenames XAMPP expects.
Source
I found a working php_uploadprogress.dll extension for xampp windows with php 5.4 here:
http://www.fsbcomputers.com/php_uploadprogress
there are 32 and 64 bit versions as well as a preview for php 5.5.
By the way, the php build numbers, apache /xampp refers to are:
PHP 5.2: 20060613
PHP 5.3: 20090626
PHP 5.4: 20100525
I hope that you are still following this, I installed php 5.4 on the latest xampp stable with no problem.
Fortunately for you, there is a beta update of xampp which makes life easier. http://www.apachefriends.org/en/xampp-beta.html
Just make sure to make a complete backup of your old xampp directory, and export your old databases so you can import them into your new (updated) mysql installation. Alternatively you do not need to update mysql, I use this beta and I can say that it's pretty solid.
EDIT: The pop-up warning were a problem that I had too, I recommend using the latest beta. But, you can fix the errors and use php 5.4 on your old install (not recommended) by commenting out the following line in php.ini
extension=php_oci8.dll
Change to
;extension=php_oci8.dll
I have done the upgrade in ubuntu. Following are the steps to do the upgrade.
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get install php5
sudo /etc/init.d/apache2 restart