I have recently change my php version 7.0 to 7.1
I tried
sudo apt-add-repository ppa:ondrej/php
sudo apt install php7.1
sudo a2dismod php7.0
sudo a2enmod php7.1
sudo apt-get install php7.1-xml
Then when i hit localhost/projectname nothing will displays.. and when u hit http://localhost/phpmyadmin/ got
phpMyAdmin - Error The mbstring extension is missing. Please check
your PHP configuration.
then i tried
sudo apt-get install php-mbstring
Nothing change.
finally
sudo service apache2 restart
No change..even i didn't get my project which is worked before.
please help me
Follow list of commands
sudo apt-get install php7.1-mbstring; #version specific mbstring
sudo apt install php7.1-mcrypt;
sudo systemctl restart apache2;
sudo phpenmod mcrypt; #enable mcrypt
sudo phpenmod mbstring; #enable mbstring
sudo systemctl restart apache2;
Caution when you switch version on ubuntu, it automatically removes some version specific extensions. You again have to explicitly
install and enable it
Please try:
sudo apt-get install php7.1-mbstring
sudo service apache2 restart
Hope it helps.
Related
I install vesta control panel on my ubuntu EC2 instance on AWS. By default vesta uses php 7.3 but my script demands php 5.6. So i had to downgrade my php version from and followed below method:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php5.6
php -v
--This may show your old version.
--So now to switching the versions 7.0 > 5.6
sudo a2dismod php7.0
sudo a2enmod php5.6
sudo service apache2 restart
sudo update-alternatives --set php /usr/bin/php5.6
--Basically need to install few modules first
sudo apt-get install php5.6-mysql php-gettext php5.6-mbstring php-xdebug libapache2-mod-php5.6
--enabling your required extensions example >>> sudo phpenmod mbstring
sudo apt-get update
sudo update-alternatives --set php /usr/bin/php5.6
sudo service apache2 restart
https://forum.vestacp.com/viewtopic.php?t=6898
After PHP 5.6 is running fine but my phpmyadmin is showing blank page. I tried many online solutions but i couldn't resolve it.
For some reason, my php cli switched to 5.6.40 instead of the 7.2 version that I had before. Then I was unable to restart apache2, so I tried to apt purge php7 & php5 to reinstall them.
But now, I only have this error:
(sorry for the French, it says packages have unsatisfied dependencies). How can I clean it ?
I have already tried the following commands :
apt-get -f install
apt-get clean
apt-get update
apt-get upgrade
You have to purge comlete php7.3:
sudo apt-get remove -y --purge php7.3*
add repository (if not exist):
sudo add-apt-repository ppa:ondrej/php
install dependents
sudo apt install php libapache2-mod-php
if you have apache:
sudo systemctl restart apache2
if you have nginx:
sudo service nginx restart
install php:
sudo apt install php-fpm
check php:
sudo service php7.3-fpm status
Actually, I don't understand what's the problem going on
You can install the zip extension for php 7 on ubuntu by using the ssh command line:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
try
sudo apt-get install php-zip
And then you need to restart apache to include this extension:
sudo service apache2 restart
As mentioned, it requires the zip extension.
You can install it by running:
sudo apt-get install php7.2-zip
I have a hard time to find exact method to install PHP intl extension in Ubuntu 14.04.
I tried with sudo apt-get install php5-intl but displays error Unable to locate package.
I really need this extension for Zend Framework 2 , because of above missing extension I am getting error like this
ERROR: Zend\I18n\Validator component requires the intl PHP extension
I am using PHP 5.5.9.
How can I install PHP-intl extension in a correct way ?
For php5 on Ubuntu 14.04
sudo apt-get install php5-intl
For php7 on Ubuntu 16.04
sudo apt-get install php7.0-intl
For php7.2 on Ubuntu 18.04
sudo apt-get install php7.2-intl
Anyway restart your apache after
sudo service apache2 restart
IMPORTANT NOTE: Keep in mind that your php in your terminal/command
line has NOTHING todo with the php used by the apache webserver!
If the extension is already installed you should try to enable it. Either in the php.ini file or from command line.
Syntax:
php:
phpenmod [mod name]
apache:
a2enmod [mod name]
install it from terminal
sudo apt-get install php-intl
May be universe repository is disabled, here is your package in it
Enable it
sudo add-apt-repository universe
Update
sudo apt-get update
And install
sudo apt-get install php5-intl
In Ubuntu 20.04, PHP 7.4 use the following command:
sudo apt-get install php7.4-intl
replace 7.4 with your PHP version
So, I have problem with it. If you can't install see below.
And previously you have to add repository.
sudo add-apt-repository ppa:ondrej/php
2.1) sudo apt-add-repository ppa:ondrej/apache2
or
2.2) sudo add-apt-repository ppa:ondrej/nginx
After that you can install
sudo apt-get install php7.4-intl
Where 7.4 your php version.
For php 5.6 on ubuntu 16.04
sudo apt-get install php5.6-intl
sudo apt-get install php-intl
then restart your server
This method works for me to install PHP intl extension in Ubuntu 18.04 and nginx
sudo apt install php7.2-intl -y
you could search with
aptitude search intl
after you can choose the right one, for example
sudo aptitude install php-intl
and finally
sudo service apache2 restart
good Luck!
I have a problem with phpmyadmin on ubuntu 16.04 after upgrading php 5.6 to php 7 by this way:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-mbstring php7.0-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0
after this command :
sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
phpMyadmin has error :
The mysqli extension is missing. Please check your PHP configuration.
But it does not have error on php5.
I want use phpMyadmin on php7.
Can anyone help me?
You need to do following steps.
php --version
Check your php version and run following command.
sudo apt-get install php5.6-mysql
In my case my version of php is 5.6, you may have different. Replace your version and hit enter.
After installing just run
sudo service apache2 restart
Hope it will help
You first need to install php7 , then install php5.
Completely remove your php and phpmyadmin :
sudo dpkg -P phpmyadmin
sudo rm -f /etc/apache2/conf.d/phpmyadmin.conf
sudo service apache2 restart
sudo apt-get purge php.*
sudo service apache2 restart
Install php7 and php7.0-mysql and ... : https://askubuntu.com/a/705893/424146
Install phpmyadmin (on php7) : install phpmyadmin with lamp stack on ubuntu 16.04
Run these commands again to install php5.6 beside your php7:
Install php5.6 beside php7 : (I got help from this link)
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-mbstring php7.0-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0
sudo service apache2 restart
Switch PHP version:
From php5.6 to php7.0 :
sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
From php7.0 to php5.6 :
sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
Reinstall or Reconfigure PHPMyAdmin. The following worked for me:
dpkg-reconfigure phpmyadmin
Solution for Windows PC
Try to check to check your httpd-xampp config file.
Make sure the Make sure the Php-Module conform with your current php version.
example here: IfModule php5_module
Based on your migration you are using php7, so edit all the php5_module tag in your config file to php7_module and restart the apache server.