I have a requirement where I need to update the PHP and PHP-fpm to the latest version of the server. this server is hosted using Nginx and WordPress. We are using amazon Linux 2 when I disable php7.4 and enable php8 in amazon-Linux-extras and install I'm getting an error.
php error
I have a couple of questions:
what happens when I uninstall and install PHP to the latest version does it after the site?
Do we have any workaround for this PHP error?
Thanks in advance.
I'm expecting a solution to update my PHP to the latest version without any issues. I have just started learning DevOps. I'm not familiar with these errors
I removed php-json by sudo yum remove php-json and installed of php
sudo yum install php php-{pear,cgi,common,curl,mbstring,gd,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip}
Still the application works.
php-json is available in Amazon Linux Extra topic "php7.4"
$ sudo amazon-linux-extras install php7.4
Related
I tried to install opencats on linux server. Running ubuntu version is 18. When I try to install opencats via http://localhost/opencats (server ip address used as localhost) and click installwizard.php I get the following errors/warnings:
It won't work on PHP7 if it wants the MySQL extension. It has been removed. Its sounds like a very very old project you are trying to install.
I had a quick look on their homepage:
Opencats has a minimum supported PHP version of PHP 5.5, and are working towards full PHP 7 compatibility.
http://www.opencats.org/
OpenCATS does not currently support php7. It must be 5.6.X
you should install PHP5.6, Open your terminal and execute those commands as follow:
1- to install PHP5.6
sudo apt-get install php5.6
2- Now, you should know which PHP version you are using
php --version
3- To stop running the current PHP version, run the commands below to disable it for Apache2 (ex: PHP7.2)
sudo a2dismod phpX
where X is your PHP version
4- Then run the commands below to enable PHP 5.6 for Apache2 to use
sudo a2enmod php5.6
5- Now, You can install the needed PHP extensions like MySQL
sudo apt-get install php5.6-mysql
5- Restart Apache2 for the changes to apply by running the commands below
sudo systemctl restart apache2.service
Hope that this can help you.
firstly, i've installed php5 on my system, and i want to upgrade to php7.1 and
and then I download the source code from the official website, and I install it.
The installation process was success, when I checked with php -v, it displayed php7.1
But when I check with phpinfo(), it's still displays the oldest php version
how can it happen where there are two different php versions but not stack each other PHP Version 5.5.9-1ubuntu4.22
Now, the problem is how to use the latest php7.1 on my localhost
thanks beforely, i'm sorry if my questions is unexplicit
If you didn't install libapache2-mod-php7.1 yet, install it.
then deactivate the older php module:
sudo a2dismod php5
and activate the new module php7.1 in apache:
sudo a2enmod php7.1
And finally restart apache2:
sudo service apache2 restart
This is essentially a duplicate of this question which I answered earlier this week. See the accepted solution which will fix your problem.
PHP Parse error: syntax error, unexpected '?' in helpers.php 233
I also recommend just upgrading to Ubuntu 16.04 or 17.10 and using the main supported version instead of a PPA. Just my two cents.
I am running an Ubuntu 12.04 Apache2/PHP/MYSQL server that was using a deprecated version of PHP. I realized this once I tried to install the sqlite3 extension I get an error:
Failed to fetch http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/dists/precise/main/source/Sources
Research shows me that this is no longer used and instead use ondrej/php instead. This is a production server and I need to figure out steps to replace the PPA with the correct one.
Will I need to uninstall PHP and reinstall using the new packages? If so how should I go about doing this cleanly?
Is there a way to temporarily install sqlite3 without having to change repositories completely (I do not have php-dev installed at the moment either).
First you should check if there are any compatibility issues with the version you want to upgrade to (did a quick google to find this: https://github.com/squizlabs/PHP_CodeSniffer). Then, add the repository that contains the version you want, sudo apt-get update and install the version of php you want. To switch the version apache uses, do the following:
sudo a2dismod php5
sudo a2enmod php5.6
sudo service apache2 restart
How can I fix this? im trying to do a clean install of wordpress latest on ubuntu 16 running nginx for Php7
When i access :
http://blog.mysite.com/wordpress/
I get:
Your PHP installation appears to be missing the MySQL extension which
is required by WordPress.
How can i resolve this?
Simply install necessary extensions and restart fpm process:
sudo apt-get install php-mysqlnd php-mysqli
sudo /etc/init.d/php7.0-fpm restart
This is a real relief I found this post, which helped me:
How to enable MySQLi extension in php 7?
Basically, if you're running php7 instead of php5 you should run this to resolve this issue:
sudo apt-get install php-mysql
and yes, as #Kris mentioned:
reload your webserver
I updated my server from PHP 5.5 to PHP 7. Now Orange HRM is not Working.
Production is on hr.oyasys.com . Error happen only after login (http://hr.oyasys.com/index.php/dashboard)
stack trace
at ()
in SF_ROOT_DIR/lib/vendor/symfony/lib/controller/sfController.class.php line 182 ...
if ($this->getActionStack()->getSize() >= $this->maxForwards)
{
// let's kill this party before it turns into cpu cycle hell
throw new sfForwardException('Too many forwards have been detected for this request.');
}
I don't think OrangeHRM has accounted for updates to PHP 7. mysql_* functions were also removed and I ran into an error or install.
https://wiki.php.net/rfc/remove_deprecated_functionality_in_php7
OrangeHRM uses the legacy mysql_connect extension which was deprecated in PHP 5.5 and was completely removed from PHP 7.
If you need to run OrangeHRM, you will have to downgrade your PHP version to 5.x or move OrangeHRM to a different compatible server.
I solved in this way to install orangehrm 3.3.0 on ubuntu 16.04
Added PPA repository
sudo add-apt-repository ppa:ondrej/php
Installed php5.6
sudo apt-get update
sudo apt-get install php5.6
Installed some modules
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
Enabled php 5.6 module in apache2
Installation works fine
Downgrading is not really solving the issue, it's just working around the issue. There are a lot of people that cannot simply downgrade due to restrictions with other software running, and in some cases, IT policy.
It sucks, but we're not getting any love or a real solution until OrangeHRM does the changes necessary to support being run under PHP 7.