I installed Wamp64, comes with 3 versions of php 5.6, 7.0 and 7.1
When I try to create a new symphony project I receive this error:
Could not find package symfony/skeleton with stability stable in a version > installable using your PHP version 5.6.31.
Obviously I need to activate php7 which I did, I restarted wamp services(apache ...etc) and I still get the same error. Please see attached image
Your PHP path probably points to the bad PHP version.
Try to type
php -v
If the version is not good you can change it by changing your path by typing, environment variable in your Windows search bar.
After that edit the value of the var Path and add the PHP bin folder
For me :
C:\PHP\bin\
And that's all
(Try to learn docker or install your development environment manually and use PHP built-in server to run your project, wamp is good when you start but you don't know how all work and this is bad :( )
i have same issue :
php --version
PHP 7.3.9 (cli) (built: Feb 17 2020 12:46:14) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.9, Copyright (c) 1998-2018 Zend Technologies
But symfony always output :
Could not find package symfony/website-skeleton with stability stable in a
version installable using your PHP version 5.6.30.
Related
May i know how to install php-mbstring. Here are my server version:
OS:NAME="Red Hat Enterprise Linux Server"VERSION="7.4 (Maipo)"
PHP:
PHP 7.3.4 (cli) (built: Apr 2 2019 13:48:50) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies
I am restricted to connect to the internet. The only way to install php extensions is by downloading rpm. Here are the php extensions installed:
php-gd-7.3.4-1.el7.remi.x86_64
php-7.3.4-1.el7.remi.x86_64
php-sqlsrv-5.6.1-2.el7.remi.7.3.x86_64
php-json-7.3.4-1.el7.remi.x86_64
php-pdo-7.3.4-1.el7.remi.x86_64
php-cli-7.3.4-1.el7.remi.x86_64
php-pdo-dblib-7.3.4-1.el7.remi.x86_64
php-xml-7.3.4-1.el7.remi.x86_64
php-common-7.3.4-1.el7.remi.x86_64
php-soap-7.3.4-1.el7.remi.x86_64
php-pecl-mcrypt-1.0.2-1.el7.remi.7.3.x86_64
php-pgsql-7.3.4-1.el7.remi.x86_64
Kindly point me to the right direction to get the installer for php-mbstring. My application is very dependent from this function. PHP 5.XX works perfectly fine but I need to update my PHP version.
Thank you
You obviously need the php-mbstring package.
Please be aware than
RHEL 7.4 is outdated and unmaintained, current is 7.7
PHP 7.3.4 is outdated and unmaintained, affected by various security issues, including a critical one, current is 7.3.11
BTW, you can download php-mbstring-7.3.4-1.el7.remi.x86_64.rpm from online archive.
I'm on Ubuntu 16.04 and I'm trying to install prestashop e-commerce CMS that requires php zip extension to unzip the main CMS folder.
I have installed php-zip and php7.2-zip and I also restarted the web server (apache2) but the CMS still displays the following message
An error has occured:
You must install PHP zip extension first
Here's the result of my installed php zip packages and my current php version:
eljaouhari#eljaouhari-HP-350-G1:/var/www/html$ php -v
PHP 7.2.5-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May 5 2018 04:59:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.5-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
eljaouhari#eljaouhari-HP-350-G1:/var/www/html$ apt list --installed | grep php | grep zip
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
php-zip/xenial,xenial,now 1:7.2+60+ubuntu16.04.1+deb.sury.org+1 all [installé]
php7.2-zip/xenial,now 7.2.5-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
I spent an hour and a half trying to figure out whether I need to activate the extestion on the php.ini file and also installing and reinstalling and restarting the web server but nothing seems to work.
I have tried a few solutions on the web that used to work for me but I can't seem to find a good solution.
Please help me with your experience!
I've found the solution after I printed the results of the phpinfo() function.
It seems that the version of php printed with the "php -v" command is not the version that actually apache is using. Apache ended up using the 7.0 version.
Thanks everyone.
When installing Drupal 8, just before database setup, I get a few errors and warnings, but I also see the following:
PHP
7.1.14-1+ubuntu16.04.1+deb.sury.org+1
However, doing php -v I get:
PHP 7.2.2-3+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Feb 6 2018 16:11:23) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.2-3+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
Clearly, my web server is running 7.2 but Drupal thinks it's 7.1. This is causing a problem where I have gd installed on PHP 7.2, but Drupal doesn't see gd installed on PHP 7.1 (because it isn't, at least its php.ini file doesn't have the gd extension enabled). Same with a few of the other errors and warnings.
How can I get Drupal 8 to recognize the correct PHP version?
So I figured it out:
Runing sudo a2dismod php7.1 then sudo a2enmod php7.2 seems to work perfectly (after a restart of Apache).
Try To install using composer
This method creates a project in web folder and other files outside web folder
composer create-project drupal-composer/drupal-project:8.x-dev d8_test_project --stability dev --no-interaction
Or
This method creates a project in a normal folder structure
composer create-project drupal/drupal my_site_name 8.*#dev --no-dev
I don't think it's about "recognizing" version, but you most likely have 2 different versions, one for console and other for web server. Run phpinfo() and see what PHP version is used by web server.
I am running OSX El Capitan (version 10.11.6).
I had php 5.5 installed.
Phpunit requires php5.6 and more so I tried to upgrade my php to 5.6. I couldn't do it so I gave php7 a try.
I followed these guides:
https://coolestguidesontheplanet.com/upgrade-php-on-osx/
https://php-osx.liip.ch/
Mac upgraded PHP to 5.6, but CLI php -v get 5.3.28?
My current output with php -v is :
PHP 7.0.12 (cli) (built: Nov 1 2016 10:21:11) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.12, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
Funny thing, my output with a phpinfo(); when called from somewhere inside a Symfony project, is still PHP Version 5.5.36
Any ideas??
Terminal uses a different PHP than a HTTP server in browser. You can check what PHP you're using in CLI (command line interface) by this terminal command:
$ which php
I don't know if you use any AMP stack (like MAMP). They include their own PHP, so you need to update them in order to have a different PHP version in browser.
Maybe you can use this trick to determine what PHP versions you use in browser / CLI: Find the php.ini path in your phpinfo() output and compare it with this terminal command:
$ php -i | grep php.ini
It's always a good idea to use the debug URL to troubleshoot your Symfony projects; to use this, simply append:
app_dev.php
For example if your route was like http://myhome/, then you would use:
http://myhome/app_dev.php
Then on the bottom of your browser you will have the Symfony debug bar. In the bottom right corner, the version of Symofny is shown, an if you move your mouse over it, you will see the version of PHP; plus also a link to "View phpinfo()". You can click on it to view the full PHP information, including where the PHP file is located.
The PHP config file used (shown on the phpinfo() page) is shown by:
Loaded Configuration File
Hope that helps!
I am new to chef and trying to configure the php cookbook to install php 5.4.8 instead of the default php 5.3.10 on Ubuntu.
I've tried adding this setting in the attributes/default.rb file of my custom cookbook:
default['php']['version'] = '5.4.8'
but the installed version is still 5.3.10
php -v
PHP 5.3.10-1ubuntu3.4 with Suhosin-Patch (cli) (built: Sep 12 2012 19:00:43)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
How do I override the default setting for php version?
Edit:
Vagrant repo with php 5.4 based on the answer https://github.com/AlexDisler/php54-chef-env
I am new to this as well, and I did the same exact thing. I believe you need to add a package that points to the version of php you want.
Here is a recipe that you can check out.
https://github.com/homemade/chef-dotdeb
You want to add this at the top of of your run_list before you call the php recipe
ex.
If you're using vagrant (If you are not, you better go download it, it will make your life fun again) http://www.vagrantup.com
chef.add_recipe("dotdeb")
chef.add_recipe("dotdeb::php54")
chef.add_recipe("apache2")
chef.add_recipe("apache2::mod_php5")
chef.add_recipe("apache2::mod_rewrite")
chef.add_recipe("php")
I hope this helps you out.
EDIT:
I got to test this out, and it works. Goodluck!