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.
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 have installed mongodb on a new Ubuntu 18.04 server. I can access and work with the database through the command line, but cannot access it via PHP, and was wondering how other people have gotten it to work.
Following a new build of Ubuntu 18.04, and installation of LAMP, I ran:
sudo apt install mongodb-server php-pear php7.2-dev
sudo pecl install mongodb
I then added the mongodb.so extension to the php.ini file, and a phpinfo(); page shows mongodb as installed. So far so good.
If I browse to a test php page ($mongo=new Mongo();), the page fails to load though.
Through web searches, I find the https://github.com/alcaeus/mongo-php-adapter page come up a lot, and I have run the composer installation command there, but to no avail.
Installed versions are: Ubuntu 18.04.2 LTS; mongoDBv3.6.3; php 7.2.17; Apache 2.4.29
I was wondering what steps other people who have gotten PHP to work successfully with Mongodb have followed? I plan to scrap this server and start from a fresh VM install again.
I was able to install php-mongodb after adding the ppa repository ondrej/php:
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt-get install php-mongodb
try:
sudo apt-get install php-mongodb
worked for me
It appears that you're attempting to use the Mongo class from the legacy driver, but you're using the non-legacy driver so that class doesn't exist. Please look at the documentation for the updated version of the driver here. You might also consider using the MongoDB PHP Library to abstract away many of the driver calls.
Please note that there are also compatibility considerations between your versions of the PHP library, MongoDB, and the MongoDB PHP driver. You can find the compatibility information for them here.
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
On my distribution of Kali (2016.2) there was a PHP package v7.0.11 pre-installed. I'd like to use version 5.6 instead. What is the best way to remove it?
I've already tried, looking for some guides online, but PHP 7 is still pretty fresh, so there are not too many threads about it, especially while using Kali. Nevertheless, I found some clues but I didn't manage to do it properly, apparently. A lot of mess with dependencies, and overall, my whole Kali install is now broken.
After purging PHP 7, I'd like to install PHP 5.6, is there an easy way to do it with apt?
This will remove all php7 version, be it php 7.0 or php 7.1 etc..
sudo apt-get purge php7.*
I installed php 5.6 following this tutorial : http://www.drupal8.ovh/en/tutoriels/178/how-to-install-php-on-linux
To remove php 7, you can try:
sudo apt-get purge php7.0-common
I prefer to use apt remove php7.0*
This will remove php7 and related packages. It will also downgrade the version to the subsequent (lower) php version.
What is the best way to get PHP 5.3 up and running on CentOS 5.4.
My machine says I have PHP 5.3 installed but running into an issue with my script that says
Fatal error: Class 'PDO' not found in /var/www/html/lib/rb.php on line 45
It fails trying to new up a PDO class in the RedbeanPHP 3.0 lib.
How can I fix this missing PDO problem?
I tried to follow these instructions:
from http://www.computingunplugged.com/issues/issue201102/00002619002
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# THIS LINE FAILED FOR ME
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-6.ius.el5.noarch.rpm
yum erase php php-pear php-mysql php-cli php-common
yum install php53u php53u-pear php53u-cli php53u-common php53u-gd
yum install php53u-mbstring php53u-mcrypt php53u-mysql php53u-soap
yum install php53u-xml php53u-xmlrpc php53u-bcmath
UPDATE
Someone removed their answer. It was good. I'm putting it back in with exact steps.
First I had to yum install php53u-devel
To quote "
You need the PDO extension. Usually the best way to install extensions is via PECL.
Before you can install any PECL extensions you need to install the php5-dev package
sudo pecl install pdo
sudo pecl install pdo_mysql
You then need add the following to the end of your php.ini file(s). Depending on which version of PHP you installed they’ll be /etc/php5/apache2/php.ini, /etc/php5/cgi/php.ini and /etc/php/cli/php.ini.
extension=pdo.so
extension=pdo_mysql.so
"
Now I get a mysql_query_missing when trying to run sudo pecl install pdo_mysql
and not sure how to get past this.
You'll have to install the php-pdo package as well.
Edit: Maybe this helps as well: How do I enable PDO using CentOS?
I have been successfully able to install PHP-5.3 on CentOS 5.4 Linux. I needed this to be able to successfully install and run Drupal 7 - which also worked out for me. Here are the details:
This is a copy of the answer I wrote up in ServerFault: https://serverfault.com/a/392168/29205
(...for my question: https://serverfault.com/questions/391772/php-xml-install-complains-of-dependency-php-common-but-this-is-already-installed/392168#392168 )
The solution is based on the accepted answer in:
https://serverfault.com/questions/391839/how-to-force-centos-yum-to-use-a-later-version-of-a-package-dependency-already-i
In summary: move to php5.3.
Reason: support for php5.2 as been removed owing to security issues as explained in that other question's accepted answer. This removal causes mismatch of the versions of the dependencies and therefore the error seen.
Background
I wanted to run Drupal 7 on a CentOS 5.4 machine. So I needed 5.3 version of PHP.
Here are the full working steps to upgrade to PHP 5.3 with working repositories as of May 24 2012 ( I provide comments preceded by # - you don't need these, just for your info)
# Comment: sites like http://www.computingunplugged.com/issues/issue201102/00002619001
# provide a good start for remedying the problem whereby we need 5.3 on CentOS 5.4 to run Drupal 7. But although their packages worked at the time, the links are now outdated, and updates to these are below.
# comment: (as of May 2012 - the following work, the reason for failures was use of 1) older packages no longer on the server and 2) change of address of one of the servers to dl.fedoraproject.org/pub/epel (credit to: http://osdir.com/ml/centos/2012-03/msg00057.html )
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-10.ius.el5.noarch.rpm
yum erase php php-pear php-mysql php-cli php-common
yum install php53u php53u-pear php53u-cli php53u-common php53u-gd
yum install php53u-mbstring php53u-mcrypt php53u-mysql php53u-soap
yum install php53u-xml php53u-xmlrpc php53u-bcmath
# After doing the above, php -v shows 5.3.x But on attempting to install Drupal 7 you may get complaint of something "Your PHP installation is too old 5.1.6 Drupal requires at least PHP 5.2.4. See the system requirements page for more information." and php.info shows the same
# The remedy is to simply restart your apache server
service httpd restart
# credit to following for suggesting service httpd restart :-
# https://serverfault.com/a/207806/29205
# https://serverfault.com/questions/207762/centos-updating-php-via-yum-doesnt-change-the-version-apache-uses
# Drupal 7 install on CentOS 5.4 worked after applying the above steps
# If your MySQL server is not running (check by ps -ef | grep mysql ) then you can run:
/etc/init.d/mysqld
# ...to start it, and to make sure it starts when the machine is restarted or cold booted:
chkconfig mysqld on