Error for Apache2.2.15 configuration with PHP5 - php

I am trying to configure apache 2.2.15 with php5 in my linux system. I have installed both of them. But when I added libphp5.so module in httpd.conf of apache, it has given the following error while starting the server:
Starting httpd: httpd: Syntax error on line 202 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/libphp5.so into server: /etc/httpd/modules/libphp5.so: undefined symbol: ap_unixd_config
Can anybody tell me how to fix this, as I tried every possible solution by googling it but in vain?

Some newer PHP versions may not be compatible with Apache2.2. This error occurs because the function ap_unixd_config is in Apache2.2 still called unixd_config.
Try to use Apache2.4 if you need to use this PHP version, otherwise you can use an older version of PHP.

This also happens on Arch Linux when one doesn't upgrade Apache 2.2 to Apache 2.4. So if you are using Arch Linux you need to downgrade php-apache package to the version that works for you. php-apache-5.5.8-1 is still OK, whereas 5.5.11-1 is not.

On RedHat Apache2 and PHP installation is done by issuing the following commands (as root):
yum install httpd httpd-devel php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
/etc/init.d/httpd start
That's all. (I'm following this tutorial.) You may add or remove some php extensions to or from the list of packages to be installed if so desired.

Related

DOM extension on PHP 7.2 Amazon Linux 2

I'm getting the error message below from a Symfony 2.8 application running PHP 7.2.8 on an Amazon Linux 2 server.
Fatal error: Uncaught RuntimeException: Extension DOM is required. in /var/www/html/my-app/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php:45
php-xml is installed. Other common/related libraries are installed too - php-mbstring, php-common.
In phpinfo, I cannot see the "DOM" section. Below is the screen shot of the installed php-related libraries (yum list installed | grep php*)
What am I missing here?
After 2 days of nit-picking it turned out restarting php-fpm resolves the issue, though I was restarting httpd all along.
sudo systemctl restart php-fpm
Did you verify the extension is enabled in your php.ini? Did yyou happen to install the correct version of php-xml? I had a few issues while installing PHP 7.x and installing extensions. It installed 5.6 extensions instead of 7.x when no version is specified.
Try these commands
To list all modules:
php -m
And/or to list the detailed configuration:
php -i
Check the output for the php-xml extension and if it is loaded.
I read that maybephp-mbstring has to be installed too. But i am not too sure of this, altough i usually have it installed.
In CentOS (and RHEL, i suppose) PHP module (extension) dom is provided by
php74-php-xml
https://centos.pkgs.org/7/remi-x86_64/php74-php-xml-7.4.11-1.el7.remi.x86_64.rpm.html
php74-php-dom
php74-php-domxml
php74-php-simplexml
php74-php-xml = 7.4.11-1.el7.remi
php74-php-xmlreader
php74-php-xmlwriter
php74-php-xsl

Installing php7 or newest version on ubuntu 14.0

firstly, i've installed php5 on my system, and i want to upgrade to php7.1 and
and then I download the source code from the official website, and I install it.
The installation process was success, when I checked with php -v, it displayed php7.1
But when I check with phpinfo(), it's still displays the oldest php version
how can it happen where there are two different php versions but not stack each other PHP Version 5.5.9-1ubuntu4.22
Now, the problem is how to use the latest php7.1 on my localhost
thanks beforely, i'm sorry if my questions is unexplicit
If you didn't install libapache2-mod-php7.1 yet, install it.
then deactivate the older php module:
sudo a2dismod php5
and activate the new module php7.1 in apache:
sudo a2enmod php7.1
And finally restart apache2:
sudo service apache2 restart
This is essentially a duplicate of this question which I answered earlier this week. See the accepted solution which will fix your problem.
PHP Parse error: syntax error, unexpected '?' in helpers.php 233
I also recommend just upgrading to Ubuntu 16.04 or 17.10 and using the main supported version instead of a PPA. Just my two cents.

OSX - installing Apache/PHP stack trough Homebrew fails

I'm stuck. I am trying to install Apache stack on OSX 10.10.3 and i can not get PHP56 to work with Apache. I am getting
httpd: Syntax error on line 171 of /private/etc/apache2/httpd.conf: Cannot load /usr/local/Cellar/php56/5.6.10/libexec/apache2/libphp5.so into server: dlopen(/usr/local/Cellar/php56/5.6.10/libexec/apache2/libphp5.so, 10): Library not loaded: /usr/local/opt/apr-util/libexec/lib/libaprutil-1.0.dylib\n Referenced from: /usr/local/Cellar/php56/5.6.10/libexec/apache2/libphp5.so\n Reason: Incompatible library version: libphp5.so requires version 6.0.0 or later, but libaprutil-1.0.dylib provides version 4.0.0
when running
sudo bash -x /usr/sbin/apachectl -k restart
I fixed it but I don't know how precisly.
Basically I've reinstalled all PHP packages installed trough brew, and I went back to use Apache 2.4 originally installed on OSX, and not that one from brew.

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.

Running PHP 5.3 on CentOS 5.4 - fatal error Class 'PDO' not found

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

Categories