Linux add PHP 7.4 to Webmin/Virtualmin - php

My current setup of Webmin/Virtualmin has PHP 5.6 and 7.2. More and more composer packages have a requirement of PHP 7.4. I don't want to have 7.4 as the default PHP, I have sites on the server that need 5.6 (I know, not great but it's the way it is), so I'm trying to get 7.4 installed in the same structure as 7.2, in the /opt/rh folder.
The version of Linux is "CentOS Linux release 7.8.2003 (Core)"
I've tried to do this about 5 times and failed each time, there is just no information (that I can find) out there to say how to do this. Any help would be massively appreciated.

If you need to keep default version of PHP, make sure to install PHP 7.4 from [remi-safe] repos.
Install Remi Release repo and clear cache:
yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm && yum clean all
Install PHP 7.4 packages:
yum -y install php74-php-{cli,pdo,fpm,zip,gd,xml,mysqlnd}
It's clearly described in our documentation page on how to install different versions of PHP for Virtualmin.

You can have couple version of php running in the same time.
Check this
Multiple PHP Version on Centos

Related

Install MongoDB PHP Extension for PHP 8.1 (Debian)

sorry if there is a duplicate question for this but I'm trying to set this up for hours now and it just doesn't work.
I have a Debian 11 server with "KeyHelp" installed on it (little brother of plesk). It comes with PHP 7.4 but provides a simple Dashboard where you can install other PHP versions. I installed PHP 8.1 and tried to install the mongodb extension via PECL.
After "pecl install mongodb" I added "extension=mongodb.so" and after that didn't show up the extension on the phpinfo page, I double checked if the extension is really in the extension folder of php, where it was.
Turns out that I installed the extension for PHP 7.4 and not for PHP 8.1. Finally I tried to force PECL to install it for PHP 8.1 but it says "phpize8.1 command not found". I found no way to install phpize8.1, can somebody help me out with that?
Thanks in advance!
I am using Ubuntu 20.04
I have PHP 8.1 version. You have to install modules of PHP
sudo apt install php8.1-mongodb
List the modules
php -m
It's not exactly Debian. I hope it helps you.
If you run command:
sudo apt install php-dev
System will install automatically the correct version of php{x}-dev for your distribution, and all it's dependencies, included PECL.
another way is try to run:
/usr/bin/phpize
If this command works, you need to add phpize to your PATH:
PATH=$PATH\:/usr/bin; export PATH
In this way phpize will work in future.

How to install php5.5 on ubuntu 16.0.04

I am new to Ubuntu, using version 16.0.04. I am trying to install php5.5. after installation it show php5.6 when running the command php -v.
Help me to install php5.5 on Ubuntu 16.0.04
I want to run symfony framework, In PHP7.0 it get error.
Your post is not clear.
Read From this post :
https://askubuntu.com/questions/849808/installing-php5-5-on-ubuntu-16-with-apache2
The PHP 5.5 have been removed from ppa:ondrej/php, the lowest version is php5.6. Note that there are differences between php5.5 and php5.6, so you need to test your code. There is a major difference with object serialisation.

Is PHP Tidy still available in Centos 7

I'm currently trying to install PHP Tidy on a CentOS 7 server (I'm running PHP Version 5.4.16 if that helps as well), but am having problems with the install.
I've been running (as per the documentation)
yum install php-tidy
but get the following error:
No package php-tidy available.
Error: Nothing to do
I've found someone having the same problem here, and the answer is listed as
When I installed via CentOS tidy.x86_64 and php-tidy.x86_64 were installed but Red Hat could not find the php-tidy.x86_64 rpm and I had to add the EPEL repository, then I managed to install php-tidy.x86_64 and it worked
...but I'm not sure what to make of that.
I've also found via the official Tidy documentation:
On Redhat-ish linux, you must install both libtidy and libtidy-devel (PHP 5.x):
sudo yum install libtidy libtidy-devel
...however I also get the same "No package..." error.
My only lead is that it doesn't appear that any of the documentation has to do with CentOS 7 (I believe they use CentOS 6 or 5, or an older version of PHP) and some of the suggestions are that some systems require yum install php5-tidy instead. So hence my original question on if Tidy is supported on CentOS 7, or if there is something else I might be doing incorrectly.
Use the webtatic repo ... PHP 5.6 on CentOS/RHEL 7.1 and 6.7 via Yum
https://webtatic.com/packages/php56/
php56w-tidy

Is there an up-to-date version of wso2 wsf for php?

Is there a more up-to-date version of wso2's wsf framework for PHP? The latest version on GitHub doesn't seem to have an installation script, and the tutorials I've found for newer versions don't seem to work at all, despite seeming to have found the latest version (2.1.0?).
Even after finding the ./configure script it still won't make and install on our server (Ubuntu 14.04)
I was running into the same issue. I downloaded an alternate tar.gz of the source code from here:
http://dist.wso2.org/products/wsf/php/2.1.0/wso2-wsf-php-src-2.1.0.tar.gz
This does have the configure file (although I am getting compilation errors afterwards, but your environment might be different).
for those that might be interested, i have begun a rewrite of this extension using php-cpp allowing to support php >= 5.6, this is a work in progress developpment.
project here
I managed to install it successfully on Ubuntu 15.04
You have to install some required packages
apt-get install libapache2-mod-php5 libxml2 libxml2-dev php5-xsl php5-dev php5-config librampart-dev
then you have to download the source from http://dist.wso2.org/products/wsf/php/2.1.0/wso2-wsf-php-src-2.1.0.tar.gz, configure it with gcc 4.4
sudo apt-get install gcc-4.4
./configure CC=gcc-4.4
and then you can make and make install.
If you run into compiling errors check this guide https://jackson-brain.com/compiling-wso2-web-services-framework-for-php-5-5/

Install libssh2-php on PHP 5.4.9 (x64)

I have a problem with the update on php 5.4.9 (i install it with the ppa "ppa:ondrej/php5")
Now i have the problem that i can't install libssh2-php (which is required on my project)
I found some .deb files, but it's only for 32-bit systems.
So when i'm trying to install libssh2-php i have a collision with "libssh2-php:i386" and i have the following dependiesmessage:
ucf:i386 libc6:i386 (>= 2.4) libssh2-1:i386 (>= 1.0) and phpapi-20090626+lfs:i386
System: Ubuntu Server 12.04 LTS x64 | PHP 5.4.9
I also got a warning on running "php -v"
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/ssh2.so' - /usr/lib/php5/20100525/ssh2.so: cannot open shared object file: No such file or directory in Unknown on line 0
The problem is/was that the libssh2 is not aviable for PHP5.4.x AND a x64 system.
I have the same problem trying to use ondrej's ppa for ubuntu 10.04 LTS. It seams that he didn't include the sssh extension.
Apt-get tries to install the version from default package which runs into conflict (depends phpapi-20090626+lfs) with current installed version, isn't it?
Only my backup php cli script needs this extension to run. After trying to solve dependencies witout success, I switched to a shell_exec('ssh ...#...') solution as workaround.
I am only a developer with advanced admin knowledge, no apt-get or linux packaging admin professional. There maybe other solution to fix this via packaging management or maybe building the needed version from source?
EDIT:
There will be another nicer solution :-) you can use pecl to install / build the extension, here is what i have done:
$ sudo pecl install ssh2
Failed to download pecl/ssh2 within preferred state "stable", latest release is version 0.12, stability "beta", use "channel://pecl.php.net/ssh2-0.12" to install
install failed
$ sudo pecl install channel://pecl.php.net/ssh2-0.12
downloading ssh2-0.12.tgz ...
Starting to download ssh2-0.12.tgz (26,223 bytes)
[...]
Build process completed successfully
Installing '/usr/lib/php5/20100525+lfs/ssh2.so'
install ok: channel://pecl.php.net/ssh2-0.12
configuration option "php_ini" is not set to php.ini location
You should add "extension=ssh2.so" to php.ini
Afterwards I add extension=/usr/lib/php5/20100525+lfs/ssh2.so to php config.
Just do:
sudo aptitude purge php5-suhosin
It's described in detail here: bugs.debian.org

Categories