Hosting laravel 5.6 on VPS? - php

hi guys am trying to host a laravel 5.6 app on a VPS for the first time and i cant seem to get it right..am using LEMP.i followed some guide which was using php 7.0 but my project requires php 7.1 "i think i managed to resolve the error using the following line"
sudo apt-get install php7.1-cli php7.1-fpm php7.1-mbstring php7.1-mysql
php7.1-mcrypt php7.1-curl
now am getting the following error
Problem 1
- Installation request for phpoffice/phpexcel 1.8.1 -> satisfiable by
phpoffice/phpexcel[1.8.1].
- phpoffice/phpexcel 1.8.1 requires ext-xml * -> the requested PHP extension
xml is missing from your system.
Problem 2
- phpoffice/phpexcel 1.8.1 requires ext-xml * -> the requested PHP extension
xml is missing from your system.
- maatwebsite/excel 2.1.28 requires phpoffice/phpexcel ^1.8.1 -> satisfiable
by phpoffice/phpexcel[1.8.1].
- Installation request for maatwebsite/excel 2.1.28 -> satisfiable by
maatwebsite/excel[2.1.28].
this is my first time so any useful information is very welcome :)

You would need to install the php-xml package. You can do it using the following command:
sudo apt-get install php-xml
When the package is installed run the composer install again.
You can read more about this issue here: https://laracasts.com/discuss/channels/servers/how-do-i-install-the-dom-extension-for-php7
edit:
if it does not install the correct version of the package, you can use the command from #Dharma Saputra's comment:
sudo apt-get install php7.1-xml

Related

phpDocumentor installation fails in laravel using composer

I am trying to install phpdocumentor using composer by doing composer require phpdocumentor/phpdocumentor in a laravel 5.3 project for generating documentation. I am using a linux machine with ubuntu16.04 and my php version is 7.0. I am getting the following error
- Can only install one of: symfony/translation[v2.5.5, v3.1.10].
- Can only install one of: symfony/translation[v2.5.6, v3.1.10].
- Can only install one of: symfony/translation[v2.5.7, v3.1.10].
- Can only install one of: symfony/translation[v2.5.8, v3.1.10].
- Can only install one of: symfony/translation[v2.5.9, v3.1.10].
Installation request for symfony/translation (locked at v3.1.10) -> satisfiable by symfony/translation[v3.1.10].
Installation failed, reverting ./composer.json to its original content.
Problem is that laravel requires symfony/translation version upwards of 3.1 i.e. ^3.1.* but phpdocumentor/phpdocumentor supports symfony/translation only until 2.8.9.
So what can I do if I want to install phpdocumentor along-with laravel5.3?
Try this
sudo apt-get install php5-xsl
sudo /etc/init.d/apache restart
worked for me on Linux ubuntu 16.04 to intall XSL.
I guess there is no way to install phpdocumentor alongwith laravel using composer. I tried installing php7.0-xsl and tried doing a number of hacks like deleting the composer.lock file and then doing composer install etc to no avail. I could finally get it to work using pear. Precisely doing
sudo pear channel-discover pear.phpdoc.org
sudo pear install phpdoc/phpDocumentor
For more info refer here

The requested PHP extension dom is missing from your system

So I just installed Scotchbox (a vagrant setup).
https://github.com/scotch-io/scotch-box
I'm trying to install a composer dependancy when I get the following error.
Problem 1
- phpunit/php-code-coverage 4.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/php-code-coverage 4.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/php-code-coverage 4.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- Installation request for phpunit/php-code-coverage (locked at 4.0.8) -> satisfiable by phpunit/php-code-coverage[4.0.8].
What I've tried
Some other thread suggested that this is included in the php-xml package. I tried installing this doing
sudo apt-get install php7.0-xml
sudo service apache2 restart
But that didn't work.
Any idea what other solutions might work? I'm starting to pull my hair out.
For me the selected answer didn't work.
This did work:
sudo apt-get install php-xml
This was on Ubuntu 16.04 with PHP 7.
Try
sudo apt-get install php7.0-common
use sudo apt-get install php7.2-xml if you are using ubuntu and php-fpm7.2
I am using Ubuntu 17.10 and PHP 7.1 is running well using:
sudo apt-get install php7.1-xml
and then (if using apache)
sudo service apache2 restart
or if on nginx you can use this:
sudo service nginx restart
Try this for PHP 7.4:
sudo apt-get install php7.4-xml
And for PHP 8.0:
sudo apt-get install php8.0-xml
First,
yum search php-xml
Then, choose one to yum install
yum install php71-php-xml.x86_64
Centos7 php7

PHP | "The requested PHP extension bcmath is missing from your system."

Greetings fellow developers,
I am trying to use composer for a PHP project of mine on a development server I recently booted up and for some reason I am unable to. I successfully installed composer, however, when I try to run the require command I get the following error:
root#webserver:/var/mypersonal/index# composer require php-amqplib/php-amqplib
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_openssl.dll' - /usr/lib/php/20151012/php_openssl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^2.6 for php-amqplib/php-amqplib
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- php-amqplib/php-amqplib v2.6.3 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
- php-amqplib/php-amqplib v2.6.2 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
- php-amqplib/php-amqplib v2.6.1 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
- php-amqplib/php-amqplib v2.6.0 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
- Installation request for php-amqplib/php-amqplib ^2.6 -> satisfiable by php-amqplib/php-amqplib[v2.6.0, v2.6.1, v2.6.2, v2.6.3].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
- /etc/php/7.0/cli/conf.d/20-calendar.ini
- /etc/php/7.0/cli/conf.d/20-ctype.ini
- /etc/php/7.0/cli/conf.d/20-exif.ini
- /etc/php/7.0/cli/conf.d/20-fileinfo.ini
- /etc/php/7.0/cli/conf.d/20-ftp.ini
- /etc/php/7.0/cli/conf.d/20-gettext.ini
- /etc/php/7.0/cli/conf.d/20-iconv.ini
- /etc/php/7.0/cli/conf.d/20-json.ini
- /etc/php/7.0/cli/conf.d/20-mysqli.ini
- /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.0/cli/conf.d/20-phar.ini
- /etc/php/7.0/cli/conf.d/20-posix.ini
- /etc/php/7.0/cli/conf.d/20-readline.ini
- /etc/php/7.0/cli/conf.d/20-shmop.ini
- /etc/php/7.0/cli/conf.d/20-sockets.ini
- /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.0/cli/conf.d/20-sysvsem.ini
- /etc/php/7.0/cli/conf.d/20-sysvshm.ini
- /etc/php/7.0/cli/conf.d/20-tokenizer.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, deleting ./composer.json.
I'm assuming it's something to do with the PHP warning I recieve right when running the composer require command but no google search results lead me to the correct direction.
Additionally, I have provided my /etc/php/7.0/cli/php.ini file incase of an error in that file.
https://gist.github.com/anonymous/bc5bac59d684cbf575cef931ef36daf6 (I couldn't include the file in this post due to the character limit on posts.)
Thank you.
You can use function get_loaded_extensions to see if bcmath modul is loaded. Or in terminal php -m or php -m | grep name_of_the_modul
You can install it depending on what OS you are using:
Ubuntu
sudo apt install php7.0-bcmath
CentOS
yum install bcmath
PHP 7.2
Debian - jessie
apt-get update
apt-get install php7.2-bcmath
work like a charm :)
For any version in php Centos use
This solution worked for me
yum install php-bcmath
PHP will take the default version installed in the machine, search for that package and install it.
Delete the file composer.lock file if that is already created and then run again,
composer install
If you run
composer update
it will update whatever default packages are installed in composer.json which might create problem for you.
In Ubuntu 20.04
For php 7.4.3, sudo apt install php7.4-bcmath
For PHP 7.1, the following worked for me:
sudo apt install php7.1-bcmath
If you are using Docker:
bcmath can be installed by running this command inside a container: docker-php-ext-install bcmath
check your php version by type: php --version
you will see something like this:
PHP 7.2.9-1+ubuntu16.04.1 ....
then sudo apt install phpX.X-bcmath where X.X is php version, so for this ^ example it will be sudo apt install php7.2-bcmath
after this check if module existed or not by type php -m | grep bcmath
php 7.2 if you have other version just change it accordingly
For CentOS
sudo yum install php72-bcmath
For Ubuntu
sudo apt install php7.0-bcmath
Run this command, hope it will works
sudo apt-get install php-bcmath
hope this will fix the problem.
sudo apt install php-bcmath
For this problem we should use sudo apt install php-bcmath
Strange thing here
Some month ago I have installed all PHP version in the same manner. In here are the 4 identically configured version of php: 5.6, 7.0, 7.1, 7.2, with the same extensions ( when this was made possible ).
The strange thing was that bcmath is present for all php version excluding 7.1.
In the solution search I arrive here in this question, where the logic's things was confirmed installing bcmath, but in my Linode Debian 9 server the command
apt install php7.1-bcmath
doesn't work, with 3 error messages;
E: Impossible to find the package php7.1-bcmath
E: Impossible to find some package with glob "php7.1-bcmath"
E: Impossible to find a package with the regular expression "php7.1-bcmath"
The goals no meet with any combination of tips and trick, refreshing apt cache, change Debian's mirrored server, installing yum, so on...
After some tentatives I had an illumination: modificating of /etc/apt/sources.list enabling the default Linode repository, then after an apt update (with no solution in the immediate), I have restored the /etc/apt/sources.list commenting out the Linode mirror sources again. Magically, after the new apt update the command now are working.
By this I confirm: apt install php7.1-bcmath is the right command, but your Debian can need a kick in the ass
Install with this command, thats work for me
apt-get install php-bcmath
I tried below package and it worked in Php version 5.6
yum install php56w-bcmath
For those who have already tried installing bc-math and still composer is giving errors.
Try this command
rm composer.lock
It will definitely work

Installation of Magento 2 error: php ext-gd is required

I am trying to install magento/product-community-edition 2.1.3 in cloud9 (Ubuntu 14.04.3 LTS) with PHP 7.0.15
I get the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for magento/product-community-edition 2.1.3 -> satisfiable by magento/product-community-edition[2.1.3].
- magento/product-community-edition 2.1.3 requires ext-gd * -> the requested PHP extension gd is missing from your system.
To enable extensions, verify that they are enabled in those .ini files:
- /home/ubuntu/.phpbrew/php/php-7.0.15/etc/php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
I tried to do the following installation on install php70-gd on ubuntu but I still get the same error afterwards.
How will I successfully install magento 2?
Use following command to install the gd extension:
sudo apt-get install php5.6-gd
it will work for PHP version 5.6
If you are using any other verison of PHP, replace 5.6 by that like:
sudo apt-get install php7.0-gd
for PHP 7.0
run
sudo apt-get install php5.6-gd
or
sudo apt-get install phpX.X-gd
then check your .ini files:
To enable extensions, verify that they are enabled in your .ini
files:
- /etc/php/7.0/cli/php.ini
change
;extension=...
to extension=... for each dependency you need.
If the error is still there, check the PHP version on your localhost/server and the PHP version that you are using with your Magento.
Be aware that all versions of PHP are not compatible to Magento.
More informations: http://devdocs.magento.com/guides/v2.0/comp-mgr/trouble/cman/php-version.html
Good luck!
PS: If you got the same issue for ext-mcrypt, ext-dom or anything else, you will have to follow the same process and then re-run the composer installation.
sudo apt-get install php7.0-dom
sudo apt-get install php7.0-mcrypt
sudo apt-get install php7.0-curl

Composer installation requirements

I am trying to install composer to the laravel project.
When im doing sudo composer install in projects directory it shows me two errors:
Problem 1
- Installation request for simplesoftwareio/simple-qrcode dev-master -> satisfiable by simplesoftwareio/simple-qrcode[dev-master].
- simplesoftwareio/simple-qrcode dev-master requires ext-gd * -> the requested PHP extension gd is missing from your system.
Problem 2
- Installation request for esendex/sdk ^1.3 -> satisfiable by esendex/sdk[v1.3.0].
- esendex/sdk v1.3.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
I was checking how to install it and I found these commands:
composer require simplesoftwareio/simple-qrcode
composer require esendex/sdk
Anyway, they are giving me the same error. Is there anything I can do about it?
Looks like you have some PHP modules missing.
For PHP5
sudo apt-get install php5-curl
sudo apt-get install php5-gd
For PHP7
sudo apt-get install php7-curl
sudo apt-get install php7-gd
Packages may be different depending on your OS
Is there anything I can do about it?
Yes. You can install the two PHP modules that Composer tells you are required:
simplesoftwareio/simple-qrcode dev-master requires ext-gd * -> the requested PHP extension gd is missing from your system.
esendex/sdk v1.3.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
Exactly how you do that will depend on your operating system.
Ubuntu 16.10, for example, offers php-gd and php-curl system packages.

Categories