How to install PHP on Visual Studio Online / Codespaces
Get the solution ↓↓↓Constant error for any and all versions of PHP - no installation candidate. I've ran apt-get update and upgrade / dist-upgrade and added the sury repo on a new codespace.
vsonline:~/workspace$ sudo apt-get install php
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php is a virtual package provided by:
php7.4 7.4.6-1+0~20200514.17+debian9~1.gbp0f509e [Not candidate version]
php7.3 7.3.18-1+0~20200515.59+debian9~1.gbp12fa4f [Not candidate version]
php7.2 7.2.31-1+0~20200514.41+debian9~1.gbpe2a56b [Not candidate version]
php7.1 7.1.33-16+0~20200514.38+debian9~1.gbp1e5820 [Not candidate version]
php7.0 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f [Not candidate version]
php5.6 5.6.40-29+0~20200514.35+debian9~1.gbpcc49a4 [Not candidate version]
php7.3 7.3.14-1~deb10u1 [Not candidate version]
uwsgi-plugin-php 188.8.131.52+8+0.0.3+b3 [Not candidate version]
php7.3 7.3.11-1~deb10u1 [Not candidate version]
php7.0 7.0.33-0+deb9u7 [Not candidate version]
php7.0 7.0.33-0+deb9u6 [Not candidate version]
E: Package 'php' has no installation candidate
I'm having the same headache, but I decided to do the manual installation
#Or the version of your preference
Unpack and install
tar zxf php-x.x.x
./configure --enable-fpm --with-mysqli
sudo make install
Obtain and move configuration files to their correct locations
cp php.ini-development /usr/local/php/php.ini
cp /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf
cp sapi/fpm/php-fpm /usr/local/bin
Or if you prefer to use Docker I recommend the laradock that makes the job much easier. I ended up using it, Doc is very easy Laradock DOC
Share solution ↓
Link To Answer People are also looking for solutions of the problem: call to a member function getclientoriginalname() on null
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.