Just installed a clean copy of ubuntu and php (to start a wordpress blog)
As recommended here, I installed php with
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
Which worked great. I can even confirm that PHP v7.0.22 is installed -
> php --version
PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.22-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies
I made some changes to Nginx in order to get it to read PHP files, and I'm trying to restart the php service -
> sudo service php7.0-fpm restart
Failed to restart php7.0-fpm.service: Unit php7.0-fpm.service not found.
- which it's claiming is not found.
In fact, it looks like there is no service at all with a name like "php" installed when I run sudo service --status-all to list everything.
Do I have to do something extra to install the PHP service?
Thanks!
Related
Im using PHP 7.3 16.04.7 LTS Xenial, and I cant enable the module SoapClient in my phpinfo().
I already remove the ";" in my php.ini configuration and restart the apache2 to enable the soap module.
The next thing I was recomended doing was to install the php package with
When I run:
sudo apt install php7.0-soap
I get
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php7.0-soap : Depends: php7.0-common (= 7.0.33-0ubuntu0.16.04.16) but 7.0.33-20+ubuntu16.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
When I check for held packages with:
dpkg --get-selections | grep hold
I get nothing.
When i run:
php -v
I get:
PHP 7.3.16-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Mar 20 2020 13:51:21) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.16, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.16-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
How can I get out of this broken state where I cant install what I need, and I cant solve held broken packages?
I've installed Xdebug in my system. Then in PhpStorm I've done all the configuration to debug the code using Xdebug.
But in Xdebug is not working properly with PhpStorm. So I would like to remove Xdebug from my local machine. But it's unable to uninstall it.
Using the following command I understood it was installed in my local machine:
php -v shows:
PHP 7.3.28-2+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Jun 4 2021 21:23:19) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.28, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.28-2+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
But while ran the uninstall command I am getting the following response in terminal:
sudo apt-get remove php-xdebug
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'php-xdebug' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 58 not upgraded.
Previously I was using Xdebug v2.9.8, it was working fine and I was able to debug the code. So I would like to install the same version.
So looking forward for your support to uninstall version 3 and proper command to install version 2.9.8 in my PHP 7.3 version.
I have installed composer but when I try to run $ composer I get the following error:
php: error while loading shared libraries: libicui18n.so.55: cannot
open shared object file: No such file or directory
The php -v command returns:
PHP 7.1.23-2+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 15 2018
11:37:26) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine
v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.23-2+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
I have tried to search for libicu in synaptic and I installed libicu60!
However, php composer.phar works fine
composer shouldn't need that dependency, but in case it really does, this should work:
wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb
sudo dpkg -i libicu55_55.1-7_amd64.deb
sudo apt-get -f install
However, I'd post that as a bug to composer maintainers (github repo), because the package should have this as a dependency and install it along the way with apt.
Composer.phar is really a standalone program, so it doesn't need other dependencies. much like a snap package.
Trying to configure my Vagrant server to use Xdebug. Read that it comes with Xdebug, but I checked this and doesn't seem to be true.
SSH into Vagrant machine,
$ php -v
reveals that machine is using
PHP 7.2.0-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Nov 30 2017 13:58:33) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.2.0-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies with blackfire v1.18.0~linux-x64-non_zts72, https://blackfire.io, by SensioLabs
No xdebug. So I tried installing xdebug with
$ brew install homebrew/php/php72-xdebug
Seemed to work. But then I tried finding the path to xdebug.so:
$ locate xdebug.so
/usr/lib/php/20131226/xdebug.so
/usr/lib/php/20151012/xdebug.so
/usr/lib/php/20160303/xdebug.so
Tried putting all of these into php.ini, and they all failed.
Tried installing via
$ sudo apt-get install php7.2-xdebug
E: Unable to locate package php7.2-xdebug
So, I searched, and found:
$ apt search xdebug
Sorting... Done
Full Text Search... Done
php-xdebug/xenial,now 2.5.5-3+ubuntu16.04.1+deb.sury.org+1 amd64 [installed] Xdebug Module for PHP
What am I doing wrong to get Xdebug and php configured on my remote machine?
I was testing with Postman using the mapped domain.. Using the actual server IP works.
So, instead of "restfulapi.dev", hit "128.153.123.21" or whatever it is.
Very silly.
I've just moved from a WAMP installation to Homestead and I can't get my app running.
When running composer install I get this error:
Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'
Many people seem to have problems with that but most of them use custom installation (they install php from scratch for example). I have just followed the steps here.
I tried to grep mcrypt from php --info and not a single line is returned so I assumed mcrypt is not install.
I've run sudo apt-get install php5-mcrypt and it says:
php5-mcrypt : Depends: phpapi-20121212
I could try to install this dependency but I'm wondering if I'm doing something wrong (the point of using Homestead was to get rid of everything but the project itself, I assume).
The php version used in the vm:
PHP 7.0.2-4+deb.sury.org~trusty+1 (cli) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans
(Not sure why it's php 7, I've never asked for that.)
Any help would be greatly appreciated :)
The latest Homestead with PHP7 does not support Laravel 5.0, out of the box.
As mentioned above in the comments this worked:
git clone -b 2.0 https://github.com/laravel/homestead.git