Installing ZipArchive on PHP7.4? - php

I'm running PHP7.4 on CentOS7 and am having trouble getting the zip module to show up when I run php -m
I tried installing php-zip and php-pecl-zip through yum, which gives me the following result:
Resolving Dependencies
--> Running transaction check
---> Package php72w-common.x86_64 0:7.2.34-1.w7 will be installed
Removing php72w-common.x86_64 0:7.2.34-1.w7 - u due to obsoletes from installed php-common-7.4.21-1.el7.remi.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package php72w-common.x86_64 0:7.2.34-1.w7 will be installed
--> Finished Dependency Resolution
Does this mean the zip module is already installed by default onto PHP7.4? Is there a reason I can't get it to activate?
I also added 40-zip.ini as per another Stackoverflow answer under /etc/php.d/ but no dice. I've also restarted my apache webserver (systemctl restart httpd).
Can someone tell me what the message means and what I can do to install ZipArchive onto my server? Any help would be appreciated, thanks!

Related

Installing PHP on a server where HTTPD was installed by source

There is one server where Apache HTTPD was installed by source, so, there is no Yum/RPM register of installed Apache HTTPD.
When trying to install PHP 5.x packages using yum, it gives errors saying the dependent package "httpd" was not found.
What's the correct approach to install PHP and the remaining PHP RPM children packages (as example php-pecl-jsonc RPM), since yum is not allowing it to be installed?
The problem was solved installing the PHP RPM files ignoring the dependencies from HTTPD and then moving the mod_php files (mod_php.so) from the original source directory into the respective modules directory from the HTTPD installed by source.

Resolving php56w-common conflicts with php-common for PHP OAuth Package

I am need to enable PHP OAuth for a QuickBooks integration. I am working on a centos 6 system. My attempts to install php-pecl-oauth via yum throws this error:
php56w-common-5.6.27-1.w6.i386 conflicts php-common
I tried adding --skip-broken, but that doesn't resaolve the issue; it just skips the package I am trying to install. I also tried yum install php56-pecl-oauth, but that package doesn't exist.
I've tried googling and haven't found a real hit yet. Anyone know how to overcome this?

How do I use php-fpm on RHEL 7.2?

I'm new to configuring Apache and I'm trying to optimize my Apache server. Reading through the documentation, I found that I should be using the Event MPM instead of the Prefork MPM. Everything was straight forward until this point as I only had to comment out Prefork and uncomment Event in 00-mpm.conf. However, when I restarted Apache, I got the following error -
AH00526: Syntax error on line 31 of /etc/httpd/conf.d/php.conf: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
Digging for some more information, I found out that mod_php should not be used with Event. So, I'm commented out php_value in php.conf and also commented out LoadModule in 10-php.conf.
My webpages wouldn't load anymore and I realized that I should be using php-fpm. However, documentation regarding this is really unclear and I'm not sure how to use it. I tried this -
[root#ip-xxx-xx-xx-xxx ~]# yum install php-fpm
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Resolving Dependencies
--> Running transaction check
---> Package php70w-fpm.x86_64 0:7.0.4-1.w7 will be installed
--> Processing Dependency: php70w-common(x86-64) = 7.0.4-1.w7 for package: php70w-fpm-7.0.4-1.w7.x86_64
--> Running transaction check
---> Package php70w-common.x86_64 0:7.0.4-1.w7 will be installed
--> Processing Conflict: php70w-common-7.0.4-1.w7.x86_64 conflicts php-common < 5.5.0
--> Finished Dependency Resolution
Error: php70w-common conflicts with php-common-5.4.16-36.el7_1.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I'm not sure how to proceed and would really appreciate any help with this problem. Thank you!
You will need to remove your current installation of php and php-common will be uninstalled as a dependency.
I can confirm that I have just done this and found that when I uninstalled php a large number of related packages were also removed, so you will need to add the relevant php70w versions of various plugins (such as php70w-fpm, php70w-mysql, etc)
I also found that roundcube was uninstalled, but am now planning to install the latest version of this now that I have PHP 7

memcached php sessions on heroku

I had noticed that an application I have setup on heroku only shows sessions variables on random requests when I refresh the browser. I put this down to the fact the application is running on 5 dynos.
I followed the following tutorial to solve this with memcached using memcachedcloud.
https://devcenter.heroku.com/articles/php-sessions#storing-sessions-in-memcached
The issue still remains though. I am using the PHP slim framework, is there any further config I need for this? I cant seem to find anything in the slim docs.
EDIT:
I can not produce the required composer.lock file because when running.
composer update
I get the error
The requested PHP extension ext-memcached * is missing from your system.
But it is in fact installed. I can see the version from typing.
memcached -h
But it is not present when typing
composer show --platform
Depending on what platform you're running, you have to make sure you that composer updates. Even if you have memcached installed, it has to match your PHP version. Then, once installed, run composer update
For example:
If you have PHP5.6.15, get memcached with, either, brew install php56/memcached or sudo apt-get install php56/memcached.
Then run composer update.
If you have an issue installing composer on Mac, you have to enable rootless install. More info can be found here:
https://donatstudios.com/OS-X-Mavericks-Memcached-PHP-Extension-Installation
The gist of the steps to take are:
Restart computer and hold Command + R to get into recover mode
Get into the terminal from Utilities
Run csrutil disable and restart
This should be done prior to installing memcached from Homebrew.
Hope this helps.
I had a similar issue, where I was getting the same "ext-memcached * is missing" error and could not see ext-memcached when running composer show --platform.
I noticed that when I originally installed memcached, homebrew showed me various alternatives. So on Mac OSX El Capitan, I ended up installing the one that matched my PHP version:
brew install homebrew/php/php55-memcached
And then I had to add it to php.ini:
extension=/usr/local/Cellar/php55-memcached/2.2.0/memcached.so
You can get the correct version path with:
brew info php55-memcached
And then I restarted Apache:
sudo apachectl restart
It finally showed up in the composer list and I was able to update composer without error.

Amazon Linux LAMP with php 5.5

I installed PHP 5.5 on my Amazon Linux VPS via the instructions here. The CLI is working fine.
I also had apache already installed and running via the httpd package. It was running without any issue.
I see that there is no mod_php in the list of available modules. Now when I try to restart httpd I get the error:
httpd: Syntax error on line 222 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 of /etc/httpd/conf.d/php.conf: Cannot load /etc/httpd/modules/libphp5.so into server: /etc/httpd/modules/libphp5.so: symbol SSLeay_version, version OPENSSL_1.0.1 not defined in file libcrypto.so.10 with link time reference
I've looked up parts of this error, and the general advice seems to be to run
yum update openssl
However, when I run this I just get:
No packages marked for update
When I run install instead of update, I get:
Package 1:openssl-1.0.1e-4.55.amzn1.x86_64 already installed and latest version
Nothing to do
I'm not sure what else to do at this point.
The php55 package in the Amazon Linux YUM repository requires the http24 package, not the http package.

Categories