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.
Related
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
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
I am very new to linux and setting up PHP in the server.
When I try to do a php -v, the php version is returning a version of 7.0, but when I checked the php version in phpinfo(), it is returning 5.5.9.
My question here is that how can I make both versions to be the same, like when I checked in to the phpinfo(), it should also have 7.0 version.
Your help would be greatly appreciated! Thank you!
First you will need to remove the php by following command. This will remove both i.e php 5 and 7.
sudo apt purge php*
Now install php7.0
sudo apt -y install php7.0 libapache2-mod-php7.0
Then restart Apache:
systemctl restart apache2
Probably, you have a ubuntu version with PHP already installed on it. Then you installed another php on it, like xampp.
Try to diagnose your own problem.
Get know which php used by CLI by type:
Which php
If you want to keep only PHP 5 running on your machine, then you must set the variable environment of your bash to running php.exe from php5 directory. Restart your machine and test it.
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.
I am trying to configure apache 2.2.15 with php5 in my linux system. I have installed both of them. But when I added libphp5.so module in httpd.conf of apache, it has given the following error while starting the server:
Starting httpd: httpd: Syntax error on line 202 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/libphp5.so into server: /etc/httpd/modules/libphp5.so: undefined symbol: ap_unixd_config
Can anybody tell me how to fix this, as I tried every possible solution by googling it but in vain?
Some newer PHP versions may not be compatible with Apache2.2. This error occurs because the function ap_unixd_config is in Apache2.2 still called unixd_config.
Try to use Apache2.4 if you need to use this PHP version, otherwise you can use an older version of PHP.
This also happens on Arch Linux when one doesn't upgrade Apache 2.2 to Apache 2.4. So if you are using Arch Linux you need to downgrade php-apache package to the version that works for you. php-apache-5.5.8-1 is still OK, whereas 5.5.11-1 is not.
On RedHat Apache2 and PHP installation is done by issuing the following commands (as root):
yum install httpd httpd-devel php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
/etc/init.d/httpd start
That's all. (I'm following this tutorial.) You may add or remove some php extensions to or from the list of packages to be installed if so desired.