How to install PHP5 with pthreads on Ubuntu? - php

I have a server which has PHP5 installed. I need pthreads and found that link to install php5 with pthreads:
PHP5 installation with pthreads
I install all the packages I need with apt-get install. I have no idea about what a make file is, how to compile a source code etc. I am a web developer with limited OS knowledge.
I have followed the steps given in the link above. At the last command on step 4, I get an error because /opt/php-zts/modules.d/ does not exist.
I simply wanted to replace existing php with a new php installation that supports pthreads. Now, the server code does not work.
How can I install PHP5 with pthreads enabled so that it will replace existing PHP5 installation that I installed with sudo apt-get install php5 libapache2-mod-php5?
Also, I have another question. I need some other packages like php-curl. Can I install them with sudo apt-get install php-curl after I succesfully install PHP? Do these commands work with custom builds?
Edit: how-to-install-pthread-in-ubuntu-12-10 This is not a solution for my problem because I don't want an isolated installation. I want the installation to replace already existing php installation.

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.

Nginx SOAP extension is installed for PHP 7.0 but not 7.4

I have an Ubuntu 16.04.6 machine and need the SOAP extension enabled for PHP 7.4, but right now it's only installed for 7.0 The extension itself is present in path /usr/lib/php/20151012/soap.so
I've used apt-get remove php-soap and the apt-get install php-soap but it does not get installed anywhere except the 7.0 folder. I have noticed in the 7.0 folder there are certain files and symlinks, which I have duplicated into the 7.4 folder structure. /etc/php/7.4/mods-available now contains soap.ini and a symlink to it named 20-soap.ini was placed in folder /etc/php/7.4/fpm/conf.d This is in keeping with all the other extensions, which were all installed almost exactly a year ago when I upgraded PHP.
In the php.ini file I have uncommented extension=soap.so and I have tried changing that line to extension=/usr/lib/php/20151012/soap.so
service php7.4-fpm restart
service nginx restart
All this to no avail. Can someone slap me upside the head and tell me what I'm missing? Should I try deleting previous PHP versions, then reinstalling the soap extension? I've seen threads mentioning specific packages for 7.4 such as php7.4-soap but this is not found in my repositories.
Any help is appreciated!
Try this command apt install php7.4-soap
sudo add-apt-repository ppa:jczaplicki/xenial-php74-temp
sudo apt-get update
sudo apt install php7.4-soap
This is adding an external PPA repository to your system. If you do not trust the maintainer you should not do this, since it possibly exposes your system. Also note that this might work for installing php, but there will not be a guarantee that you recvive updates through it (The word "temp" in the repository name indicates that this is only temporary). I would rather recommend compiling it yourself if you really need to have it installed on 16.04.
Also this will install you php version 7.4.13 , you may have to remove the already installed php 7.4 , and reinstall after you add this ppa

Installing Mongodb PHP Drivers on Ubuntu 18.04

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.

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/

How do I remove Dotdeb version of PHP and replace it with official Ubuntu repo

I'm a UBUNTU and CLI Noob.
I'm running UBUNT 12.04 LTS
I'm trying to get CURL to work for my PHP install and come to find out that PHPCURL does not work with the Dotdeb version of PHP that installed on my server.
Everything I've read so far says to remove the DOtdeb version of PHP and replace it with an official Ubuntu version however I'm not seing any clear instructions on this.
Is there an easy command to remove the Dotdeb version?
Should I just run sudo apt-get -y purge php*? I'm afraid that it will remove stuff I didn't intend to remove but I'm not sure.
Also, how do I know that the new PHP5 package I install is an official Ubuntu package?
First remove Dotdeb.org from your source list.
Next your need to uninstall php5
aptitude purge php5
Now run a simple update
aptitude update
Now reinstall php5
aptitude install php5
This really is the only way to go about it. You really need to do a purge, because simply removing it using normal uninstall does not get rid of the dotdeb config files that sometime remain.
You might just not have the php curl library installed. sudo apt-get install php5-curl will fix that.

Categories