upgrading php 5.1.6 to php 5.2 on plesk 9x? - php

how can i upgrade from 5.1.6 to 5.2 using plesk, i need this upgrade in order to build my app cheers?

From this post:
In order to upgrade PHP 5 on a Linux server to the latest version perform the following steps.
Applies to:
Plesk 8.x for Linux
Plesk 9.x for Linux
Download the installer script which updates Yum's repositories:
[root#server ~]# wget http://78.129.170.254/cpinstall/atomic
--2009-11-12 15:40:22-- http://78.129.170.254/cpinstall/atomic
Connecting to 78.129.170.254:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8918 (8.7K) [text/plain]
Saving to: `atomic'
100%[=====================================>] 8,918 35.7K/s in 0.2s
2009-11-12 15:40:22 (35.7 KB/s) - `atomic' saved [8918/8918]
Execute this downloaded script using the following command:
[root#server ~]# sh atomic
Atomic Archive installer, version 1.1
Configuring the [atomic] yum archive for this system
Installing the Atomic GPG key: OK
Downloading atomic-release-1.0-10.el5.art.noarch.rpm: OK
Would you like to add the Plesk yum repository to the system?
Enable Plesk repository? (y/n) [Default: n]: y
Plesk 8.6 and 9.2 repositories are available:
NOTE: Plesk 9 repos are only available for rhel/centos 4 and 5
Enable Plesk 8.6 or 9.2? (8/9) [Default: 8]: 9
The Atomic Rocket Turtle archive has now been installed and configured for your system.
The following channels are available:
atomic - [ACTIVATED] - contains the stable tree of ART packages.
atomic-testing - [DISABLED] - contains the testing tree of ART packages.
atomic-bleeding - [DISABLED] - contains the development tree of ART packages.
Now run yum upgrade php to upgrade the PHP to the latest version:
[root#server ~]# yum upgrade php
The PHP upgrade process will commence & will finish within the next 5 minutes.
Finally execute these 3 commands to restart the web services & to accept the new PHP:
[root#server ~]# /etc/init.d/psa stopall
[root#server ~]# /etc/init.d/psa startall
[root#server ~]# /etc/init.d/psa restart
Now check the newer installed version of PHP using the php -v command.

Related

Ubuntu Amazon Web Service LAMP stack setup

I am trying to set up a LAMP stack on my Amazon Web Service AMI, which is an Ubuntu System.
I went through this tutorial: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html
The only difference which I made is installing php 7.
I stuck at this Point: Start the MySQL server.
[ec2-user ~]$ sudo service mysqld start
Currently it Returns this error:
mysqld: unrecognized Service
Same for These commands:
[ec2-user ~]$ sudo service mysql start
[ec2-user ~]$ sudo service mysqlnd start
If I run php -i | grep mysqlnd I get following Output:
/etc/php-7.0.d/20-mysqlnd.ini, Client API library version => mysqlnd
5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $ mysqlnd mysqlnd => enabled Version => mysqlnd 5.0.12-dev - 20150407
- $Id: b5c5906d452ec590732a93b051f3827e02749b83 $ Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password mysqlnd statistics => Client API version => mysqlnd 5.0.12-dev -
20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $
On Ubuntu 16.04, the command would be:
sudo service mysql start
It looks like the MySQL server might not be installed. You can install the MySQL server and client tools with:
sudo apt-get install mysql-server
You will be asked to create a password for the MySQL root user during installation.
The tutorial you link to is for Amazon Linux, which (amongst other differences) uses a different package manager than Ubuntu to install and manage software. In the tutorial, the line sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd would have installed the mysql56-server package alongside apache and php.
If you need a web server quickly without have to worry about setup you may as well launch an instance picked from the AWS Marketplace. There are perfect Amazon Machine Images (AMI) for any situation.
For instance, Bitnami offers LAMP solutions on AWS Marketplace with no extra cost besides EC2 pricing.

Install mod_php on Centos for PHP 7

I was using Chef to provision Apache with PHP module using the httpd cookbook. However, installing mod_php with that cookbook would install the PHP 5 module , even though I had remi set up to install PHP 7 (php -v outputs version 7.1).
How do I manually install (using yum or something) Apache PHP 7 module (php7_module) on Centos 6.7?
It is installing PHP5 because that cookbook is suppose to support only upto that. If you want a change, you can go and change/update/wrapper the module_helper.rb file for your environment and test it out.
https://github.com/chef-cookbooks/httpd/blob/master/libraries/httpd_module.rb

php56 - CentOS - Remi Repo

I just installed php 5.6 on a test box, and the normal cli php interpreter doesn't appear to exist:
$ -> php -v
-bash: php: command not found
$ -> php56 -v
PHP 5.6.13 (cli) (built: Sep 3 2015 13:41:04)
If I try to do a yum install php --enablerepo=remi then it tries to install php 5.4.
So it's obvious that php56 is a cli interpreter, but I've always been used to just typing php vs php56. Is this the new norm, or is there another step for installing php56 on CentOS (6.7)? Is it as simple as creating a symlink? ln -s /usr/bin/php56 /usr/bin/php
Steps to upgrade:
$ -> yum remove php* --enablerepo=remi
$ -> yum install php56* --enablerepo=remi
Thx to Remi for the push in the right direction, here's what my repo config looks like:
[upstream_remi54]
name=Remi - CentOS - $releasever/$arch
baseurl=http://mirrors.mediatemple.net/remi/enterprise/$releasever/remi/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://rpms.famillecollet.com/RPM-GPG-KEY-remi
[upstream_remi56]
name=Remi - CentOS - $releasever/$arch
baseurl=http://mirrors.mediatemple.net/remi/enterprise/$releasever/php56/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://rpms.famillecollet.com/RPM-GPG-KEY-remi
This works well if you want to completely replace existing PHP, vs running versions in parallel. I have to keep PHP 5.4 in place for Roundcube and Postfix Admin, as some of the modules necessary for those to work have not yet been ported, so that server has to stay 5.4 for now.
php-* are base packages, 1 repository per version
"remi" => php 5.4
"remi-php55" => php 5.5
"remi-php56" => php 5.6
"remi-php70" => php 7.0 (Release Candidate, not ready for prod)
php56-* packages are Software Collections, parallel installation allowing to run multiple versions of PHP.
See : http://blog.remirepo.net/pages/English-FAQ
So, if you only want a single php version 5.6
yum --enablerepo=remi-php56 install php-cli (and other needed modules)
And you can also enable the repository for future update (as the "remi-php56" is safe and only provides php 5.6 and its extension)
yum-config-manager --enable remi-php56

Building failing at Travis-CI due to composer command call

I am trying to build my PHP project at Travis-CI but I'm getting an error when he tries to execute a composer command. The build log of my project at Travis-CI:
Using worker: worker-linux-docker-c22a70ed.prod.travis-ci.org:travis-linux-3
Build system information
Build language: ruby
Build image provisioning date and time
Thu Feb 5 15:09:33 UTC 2015
Operating System Details
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
Linux Version
3.13.0-29-generic
Cookbooks Version
a68419e https://github.com/travis-ci/travis-cookbooks/tree/a68419e
GCC version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
LLVM version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Pre-installed Ruby versions
ruby-1.9.3-p551
Pre-installed Node.js versions
v0.10.36
Pre-installed Go versions
1.4.1
Redis version
redis-server 2.8.19
riak version
2.0.2
MongoDB version
MongoDB 2.4.12
CouchDB version
couchdb 1.6.1
Neo4j version
1.9.4
RabbitMQ Version
3.4.3
ElasticSearch version
1.4.0
Installed Sphinx versions
2.0.10
2.1.9
2.2.6
Default Sphinx version
2.2.6
Installed Firefox version
firefox 31.0esr
PhantomJS version
1.9.8
ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)
Maven home: /usr/local/maven
Java version: 1.7.0_76, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.13.0-29-generic", arch: "amd64", family: "unix"
$ git clone --depth=50 --branch=master git://github.com/rgiaviti/laravel-correios-track.git rgiaviti/laravel-correios-track
Cloning into 'rgiaviti/laravel-correios-track'...
remote: Counting objects: 69, done.
remote: Compressing objects: 100% (40/40), done.
remote: Total 69 (delta 14), reused 0 (delta 0), pack-reused 20
Receiving objects: 100% (69/69), 11.17 KiB | 0 bytes/s, done.
Resolving deltas: 100% (14/14), done.
Checking connectivity... done.
$ cd rgiaviti/laravel-correios-track
$ git checkout -qf e2c8293aa5a996f5d8bbdef6788e4e2d84c15c1e
This job is running on container-based infrastructure, which does not allow use of 'sudo', setuid and setguid executables.
If you require sudo, add 'sudo: required' to your .travis.yml
See http://docs.travis-ci.com/user/workers/container-based-infrastructure/ for details.
$ rvm use default
Using /home/travis/.rvm/gems/ruby-1.9.3-p551
$ ruby --version
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
$ rvm --version
rvm 1.26.10 (latest-minor) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
$ bundle --version
Bundler version 1.7.6
$ gem --version
2.4.5
$ composer self-update
/home/travis/build.sh: line 41: composer: command not found
The command "composer self-update" failed and exited with 127 during .
Your build has been stopped.
I think the problem is here:
$ composer self-update
/home/travis/build.sh: line 41: composer: command not found
My .travis.yml file:
language: php
php:
- 5.4
- 5.5
- 5.6
- hhvm
- hhvm-nightly
before_script:
- composer self-update
- composer install --prefer-source --no-interaction --dev
I am new to Travis-CI and what I see is that composer is not installed or not working. When I read the Travis-CI documentation for PHP projects, they say that composer are available.
From the docs:
Note that we update composer every time we update the PHP build
environment, which is every 30-60 days. Because composer has a
time-based update warning, you may see messages such as this, which
may be safely ignored:
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/home/travis/.phpenv/versions/5.6/bin/composer self-update" to get the latest version.
You can also install Composer packages into the Travis CI PHP
environment. The composer command comes pre-installed, use the
following:
composer install
Maybe I am missing some configuration, but I can't figure what configuration is that.
The problem here is that your build language was set to ruby - for whatever reason. A ruby env doesn't have Composer pre-installed and your command fails.
You find the entry at the first few lines of the Travis build log.
Your composer.json and .travis.yml are allright.
In other words: you requested a PHP env with Composer.
But Travis didn't recognize this.
It's a rather strange issue and maybe it's only temporary.
Please check the file permissions - that's my only guess.
Else you might decide to jump on IRC and ask the Travis guys or file a bug.

PHP Fatal error: Call to undefined function json_decode()

Apache is logging PHP Fatal error: Call to undefined function json_decode(). After some googling, it seems this problem is a result of not having the latest version of php. Oddly, running php --version ouputs
PHP 5.5.1-2+debphp.org~precise+2 (cli) (built: Aug 6 2013 10:49:43)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.2-dev, Copyright (c) 1999-2013, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
Clearly showing that my php version is greater than 5.1.
Any ideas as to what could cause this, or the steps to take to find out?
EDIT: The result of a script echoing phpversion is 5.5.1-2+debphp.org~precise
EDIT: The result of phpinfo() is also PHP Version 5.5.1-2+debphp.org~precise+2
Furthermore, in the phpinfo(), it lists the module JSON and the module authors (Omar Kilani, Scott MacVicar).
Using Ubuntu?
Short answer:
sudo apt-get install php7.2-json
(or php7.1-json or php5-json depending on the PHP version you're running)
Then of course make sure you restart Apache:
sudo service apache2 restart
Or if you are using PHP-FPM:
sudo service php7.2-fpm restart
(Or php7.1-fpm or php5-fpm)
Explanation
Debian has removed the previous JSON extension as of PHP 5.5rc2 due to a license conflict.
The JSON license has a clause which states:
The Software shall be used for Good, not Evil.
This causes a problem with Free Software Foundation's definition of free software which states:
The freedom to run the program, for any purpose (freedom 0).
FSF goes on to specifically list the JSON license as nonfree.
Yes it seems a bit silly. Nevertheless Debian has removed the non-compliant JSON extension, and instead offered a replacement extension that is functionally equivalent.
To be clear: PHP itself has NOT removed JSON, it's still in master. This is a distro / package manager issue.
Rasmus makes it pretty clear:
We have not removed json and we will never release a version of php without json support built in. Any changes in 5.5 is due to whatever distro packaging you are using which we have no control over.
More details
http://iteration99.com/2013/php-json-licensing-and-php-5-5/
http://liorkaplan.wordpress.com/2013/06/01/bye-bye-non-free-php-json-extension/
https://bugs.php.net/bug.php?id=63520
http://philsturgeon.co.uk/blog/2013/08/fud-cracker-php-55-never-lost-json-support
With Ubuntu :
sudo apt-get install php5-json
sudo service php5-fpm restart
Solution for LAMP users:
apt-get install php5-json
service apache2 restart
Source
As a RHEL 8 user, this was fixed with:
yum install php-json
And then reloading nginx and php-fpm. So basically the json libraries where missing from the default php install.
This should also work on CENTOS 8.
If you're using phpbrew try to install json extension to fix error with undefined function json_decode():
phpbrew ext install json
The same issue with 7.1
apt-get install php7.1-json
sudo nano /etc/php/7.1/mods-available/json.ini
Add json.so to the new file
Add the appropriate sym link under conf.d
Restart apache2 service (if needed)
I have the same question: PHP Fatal error: Call to undefined function json_decode(), but I run php under cygwin on Windows. When I run php -m, I found that there is no json module installed. So I run cygwin setup.exe again, check json package from the configuration interface, and the problem is solved.
The module was install but symbolic link was not in /etc/php5/cli/conf.d
you might also consider avoiding the core PHP module altogether.
It is quite common to use the guzzle json tools as a library in PHP apps these days. If your app is a composer app, it is trivial to include them as a part of a composer build.
The guzzle tool, as a library, would be a turnkey replacement for the json tool, if you tell PHP to autoinclude the tool.
http://docs.guzzlephp.org/en/stable/search.html?q=json_encode#
http://apigen.juzna.cz/doc/guzzle/guzzle/function-GuzzleHttp.json_decode.html
CENTOS
Scene
I installed PHP in Centos Docker, this is my DockerFile:
FROM centos:7.6.1810
LABEL maintainer="teran.a.joan#gmail.com"
RUN yum install httpd-2.4.6-88.el7.centos -y
RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
RUN yum install php72w -y
ENTRYPOINT ["/usr/sbin/httpd", "-D", "FOREGROUND"]
The app returned the same error with json_decode and json_encode
Resolution
Install PHP Common that has json_encode and json_decode
yum install -y php72w-common-7.2.14-1.w7.x86_64
How to find the resolution?
I have another Docker File what build the container for the API and it has the order to install php-mysql client:
yum install php72w-mysql.x86_64 -y
If i use these image to mount the app, the json_encode and json_decode works!!
Ok..... What dependencies does this have?
[root#c023b46b720c etc]# yum install php72w-mysql.x86_64
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirror.gtdinternet.com
* epel: mirror.globo.com
* extras: linorg.usp.br
* updates: mirror.gtdinternet.com
* webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php72w-mysql.x86_64 0:7.2.14-1.w7 will be installed
--> Processing Dependency: php72w-pdo(x86-64) for package: php72w-mysql-7.2.14-1.w7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: php72w-mysql-7.2.14-1.w7.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: php72w-mysql-7.2.14-1.w7.x86_64
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.60-1.el7_5 will be installed
---> Package php72w-pdo.x86_64 0:7.2.14-1.w7 will be installed
--> Processing Dependency: php72w-common(x86-64) = 7.2.14-1.w7 for package: php72w-pdo-7.2.14-1.w7.x86_64
--> Running transaction check
---> Package php72w-common.x86_64 0:7.2.14-1.w7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================
Package Arch Version Repository Size
========================================================================================================
Installing:
php72w-mysql x86_64 7.2.14-1.w7 webtatic 82 k
Installing for dependencies:
mariadb-libs x86_64 1:5.5.60-1.el7_5 base 758 k
php72w-common x86_64 7.2.14-1.w7 webtatic 1.3 M
php72w-pdo x86_64 7.2.14-1.w7 webtatic 89 k
Transaction Summary
========================================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 2.2 M
Installed size: 17 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): mariadb-libs-5.5.60-1.el7_5.x86_64.rpm | 758 kB 00:00:00
(2/4): php72w-mysql-7.2.14-1.w7.x86_64.rpm | 82 kB 00:00:01
(3/4): php72w-pdo-7.2.14-1.w7.x86_64.rpm | 89 kB 00:00:01
(4/4): php72w-common-7.2.14-1.w7.x86_64.rpm | 1.3 MB 00:00:06
--------------------------------------------------------------------------------------------------------
Total 336 kB/s | 2.2 MB 00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 1/4
Installing : php72w-common-7.2.14-1.w7.x86_64 2/4
Installing : php72w-pdo-7.2.14-1.w7.x86_64 3/4
Installing : php72w-mysql-7.2.14-1.w7.x86_64 4/4
Verifying : php72w-common-7.2.14-1.w7.x86_64 1/4
Verifying : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 2/4
Verifying : php72w-pdo-7.2.14-1.w7.x86_64 3/4
Verifying : php72w-mysql-7.2.14-1.w7.x86_64 4/4
Installed:
php72w-mysql.x86_64 0:7.2.14-1.w7
Dependency Installed:
mariadb-libs.x86_64 1:5.5.60-1.el7_5 php72w-common.x86_64 0:7.2.14-1.w7
php72w-pdo.x86_64 0:7.2.14-1.w7
Complete!
Yes! Inside the dependences is the common packages. I Installed it into my other container and it works! After, i put de directive into DockerFile, Git commit!! Git Tag!!!! Git Push!!!! Ready!
cPanel
Go to MultiPHP INI Editor and select the Editor Mode tab, enter the following to enable JSON extensions:
extension=json.so
Or, if you have an existing php.ini file in your root directory, check if this extension is listed and make sure it's not commented out (preceded by semi-colon).

Categories