Amazon Linux LAMP with php 5.5 - php

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.

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

Laravel 5.5 : getting error while creating project

I'm creating a project of Laravel (version 5.5) in Ubuntu (version 16.04) but while i running it on browser, getting error like this:
syntax error, unexpected '?' in
/opt/lampp/htdocs/lara1/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
on line 233
I have searched a lot for this and got that there are some version problem (displaying PHP version 5.6 on browser and in CLI it's 7.0) so i'm trying to remove the PHP version 5.6 by using command
apt-get purge 'php5*'
but its showing :
Package 'php5.6-common' is not installed, so not removed
So how can i remove php 5.6 from cli and run laravel project without getting error.
I'm new to Laravel and Ubuntu.
Please help me to get this. Any help will be appreciated.
Thanks in advance.
Edited :
while running sudo apt remove php5.6 getting
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'php5.6-json' for regex 'php5.6'
Note, selecting 'php5.6-common' for regex 'php5.6'
Package 'php5.6-common' is not installed, so not removed
Package 'php5.6-json' is not installed, so not removed
The following packages were automatically installed and are no longer required:
libllvm3.8 libllvm3.8:i386 libmircommon5 libpango1.0-0 libsnapd-glib1
linux-headers-4.4.0-71 linux-headers-4.4.0-71-generic linux-headers-4.4.0-72
linux-headers-4.4.0-72-generic linux-headers-4.4.0-75
linux-headers-4.4.0-75-generic linux-headers-4.4.0-78
linux-headers-4.4.0-78-generic linux-headers-4.4.0-79
linux-headers-4.4.0-79-generic linux-headers-4.4.0-81
linux-headers-4.4.0-81-generic linux-headers-4.4.0-83
linux-headers-4.4.0-83-generic linux-headers-4.4.0-87
linux-headers-4.4.0-87-generic linux-headers-4.4.0-89
linux-headers-4.4.0-89-generic linux-headers-4.4.0-92
linux-headers-4.4.0-92-generic linux-image-4.4.0-71-generic
linux-image-4.4.0-72-generic linux-image-4.4.0-75-generic
linux-image-4.4.0-78-generic linux-image-4.4.0-79-generic
linux-image-4.4.0-81-generic linux-image-4.4.0-83-generic
linux-image-4.4.0-87-generic linux-image-4.4.0-89-generic
linux-image-4.4.0-92-generic linux-image-extra-4.4.0-71-generic
linux-image-extra-4.4.0-72-generic linux-image-extra-4.4.0-75-generic
linux-image-extra-4.4.0-78-generic linux-image-extra-4.4.0-79-generic
linux-image-extra-4.4.0-81-generic linux-image-extra-4.4.0-83-generic
linux-image-extra-4.4.0-87-generic linux-image-extra-4.4.0-89-generic
linux-image-extra-4.4.0-92-generic snapd-login-service ubuntu-core-launcher
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 212 not upgraded.
You do not need to remove the old PHP.It is indicate the php interpreter is 7 but the php-fpm is 5.6. This because the port 9000 is listened by the php-fpm that belong to php56.So you should stop all the process about php-fpm
sudo killall php-fpm // or sudo pkill -9 php-fpm
then go to the php7 folder and run the php-fpm process.
Hope it helps.
what's more,you have the right direction. Laravel5.5 need php7 or higher.Good luck!

Could not find PDO driver when installing laravel 5 on CentOS 7 with DigitalOcean

I'm trying to get my offline Laravel 5 webapp deployed. First of all I created a new droplet at DigitalOcean. Via ssh access I installed a fully working LAMP stack (I got the apache test-page at my ip-address).
After that, I pulled my git repo into the /var/www/html folder. Using composer install all my dependencies were installed.
When I visit my-ip-addres/public, I get a laravel error
PDOException in Connector.php line 55: could not find driver
I thought maybe my PDO module wasn't installed correctly but when I look in my phpinfo() file, everything looks correct.
Is there anyone who can help me out with this problem?
run this command sudo apt-get install phpX-mysql X: php version (7.0 or 5.6 or ...) and then service apache restart .

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.

Error for Apache2.2.15 configuration with PHP5

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.

Categories