We are trying to update our azure web app service to php 8.
In deployment we use kudu and app service build service.
When we try to deploy after changing to php 8 in the code we get the error that php command is not found.
And when we run compose installer we can install due to composer.lock requiering php 8.0
The only source for php 7.3 (which specifies that is the problem) is the kudu script. However we have not found a decent way of updating this to php 8. Has anyone done this?
kudu_ssh_user#:/$ php --version
PHP 7.3.27 (cli) (built: Mar 18 2021 08:28:09) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.27, Copyright (c) 1998-2018 Zend Technologies
Related
I'm using MAMP 6.5 - Build 33813 (Macbook Air M1 2020) to make some Apache hosts.
All everything is ok, except one thing. I can't use terminal commands on my PHP code (exec, copy, and others).
I uninstalled my Brew PHP and using only MAMP PHP 7.2 and 8.0 (CGI).
I receive no errors or logs, just doesn't work. This is my terminal's response when I run php -v:
PHP 7.2.34 (cli) (built: Aug 5 2021 15:20:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Image - PHP MAMP Config
Whenever I try to test PHPUnit or composer update, I get this error:
PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.4.0". You are running 7.3.19
but when I put on the terminal: source ~/.bash_profile it reads that I have 7.4 on my local machine and all works OK. Is there any solution for that issue, to not need to put every time that command source ~/.bash_profile before every start of the console?
Before run source ~/.bash_profile:
PHP 7.3.19 (cli) (built: Jun 12 2020 00:29:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.19, Copyright (c) 1999-2018, by Zend Technologies
After run source ~/.bash_profile:
PHP 7.4.13 (cli) (built: Nov 30 2020 14:57:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies
I was facing the same issue, I was using command prompt for laravel artisan commands. Which was showing wrong php version. I closed it and from Xampp Control Pannel Open the Shell for artisan commands and now its detecting the correct PHP Version. It fixed my problem.
I'm facing an issue. I've multiple projects thats using different version of PHP. I world like to have a way to define for example:
sites/project1 -> php 5.6
sites/project2 -> php 7.0
sites/project3 ->
php 7.1
I'm currently using MAMP PRO to manage web-server but my issue is regarding to command line.
I don't want to use docker or vagrant for each project just configure a specific binary php per project folder.
Is there a way to do that?
Best!
You can use phpbrew, it's very simple and convenient when you want to switch between PHP versions as well as for PHP extension management.
For changing the PHP CLI version you just run one command:
$ phpbrew list
* php-7.1.12
php-5.5.15
$ php -v
PHP 7.1.12 (cli) (built: Jan 14 2018 22:25:40) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.12, Copyright (c) 1999-2017, by Zend Technologies
$ phpbrew use php-5.5.15
$ php -v
PHP 5.5.15 (cli) (built: Nov 9 2018 00:22:21)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
If you use MAMP your php bin files are located under:
/Applications/MAMP/bin/php/php*.*.*/bin/php
I can recommend to create alias/symbolic link for each PHP version
/Applications/MAMP/bin/php/php7.1.12/bin/php => php7.1
/Applications/MAMP/bin/php/php5.6/bin/php => php5.6
etc..
I'm currently running a shared server with the multi PHP manager cPanel extension, so I'm trying to install Laravel 5.7, but I get the following exception:
Could not find package laravel/laravel with version 5.7.* in a version
installable using your PHP version 5.6.38.
But when I run php -v, it outputs the following:
PHP 7.2.11 (cli) (built: Oct 30 2018 20:57:09) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.4, Copyright (c) 2002-2018, by ionCube Ltd.
And if I do a phpinfo(), I get the following version:
PHP Version 7.0.32
So, as you can see all 3 versions are different and I don't know what is going on, any ideas?
NOTE: I don't have super user permissions, when I run commands with sudo I get the following : sudo: effective uid is not 0, is sudo installed setuid root?
I am using SublimeText to run PHPUnit tests continuosly. Works great, but now I stumbled upon something strange. I updated to the latest PHP version via Homebrew and if I open a Terminal session and type php -v, this is what I get:
PHP 5.6.7 (cli) (built: Mar 22 2015 19:03:55)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
The shell instance that is used by SublimeText seems not to use this version of PHP. If I do the same there (via writing echo shell_exec('php -v');die(); into a PHPUnit test), I get this:
PHP 5.4.24 (cli) (built: Jan 19 2014 21:32:15)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
I tested around a bit and found out, that automator puts out the same if I run a shell script in \bin\bash shell via automator's 'run shell script' action.
How to tell /bin/bash to use the newly installed PHP version?
When you issue the command $ php, the PATH is searched for the binary. You can find out which one will be executed with the command $ which php.
If you want to explicitly run one or another php binary when multiple ones are installed, use full absolute path to the binary, e.g. $ /opt/php5.6/bin/php.