Install Apache/PHP 7.2.12 on Fedora 29/28, CentOS/RHEL 7.5/6.10 - Comment Page: 1
This guide shows howto install Apache HTTP Server (httpd) with PHP 7.2.12 and following modules on Fedora 29/28/27, CentOS 7.5/6.10 and Red Hat (RHEL) 7.5/6.10 systems.
OPcache (php-opcache) - The Zend OPcache provides faster PHP execution through opcode caching and optimization.
APCu (php-pecl-apcu) - APCu userland caching
CLI (php-cli) - Command-line interface for PHP
PEAR (php-pear) - PHP Extension and Application Repository framework
PDO (php-pdo) - A database access abstraction module for PHP applications
MySQL (php-mysqlnd) - A module for PHP applications that use MySQL databases
PostgreSQL (php-pgsql) - A PostgreSQL database module for PHP
MongoDB...
[…] PeÅ‚ny artykuÅ‚ na: Install Apache (httpd) and PHP 5.3.3 on Fedora 13, CentOS/RHEL 5.5/6 […]
Thanks! Works :)
One more addition:
If you are getting the message:
“Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name, using ::1 for ServerName” when you try to restart httpd, you can give a name to the server in /etc/httpd/conf/httpd.conf file:
ServerName theNAMEyouCHOOSE:80
also you should set
UseCanonicalName On
Best,
Jozsef
When I tried to execute the first rpm command to access the remi repository, I got:
[[email protected] ~]$ rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
Retrieving http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
error: skipping http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm - transfer failed - Unknown or unexpected error
I notice that this thread is relatively recent so I was surprised that something may have broken in the past couple of weeks.
Thanks,
Jon
And just to clarify, I have been doing other yum/rpm commands all night and they have all worked fine, so it doesn’t appear to be an Internet connectivity thing or anything (and yes, I tried doing another command after this one failed and that worked as well, and I tried this several times, always failing, including on other machines.)
Thanks!
Hi Jon,
I tested this and found the problem. Epel repository has been updated to 5-4 release and now 5-3 release is removed, so the following command should work:
I updated this and other guides too, thank you for your attention.
i keep getting the error
No package php-pear available.
No package php-pdo available.
No package php-mysql available.
No package php-pgsql available.
No package php-pecl-memcache available.
No package php-gd available.
No package php-mbstring available.
No package php-mcrypt available.
No package php-xml available.
Hi Don,
What operating system do you use?
Did you added and enabled remi repository?
When i try to create a PHP test page, I get an error message saying I do not have permission to access the html file. How can I unlock the permission? All other internet resources are not giving me a clear command. Would really appreciate it!
Hi mk,
Could you post exact error message from browser and apache(httpd) error log (/var/log/httpd/error_log)?
And could you also check, do you get any SELinux warning?
I get the same error on Fedora 14
I was getting a SELinux warning but I changed the servername and Canonical as you suggested in a comment and it seems to have stopped. Now I get a 500 error.
Could you post full error message from /var/log/httpd/error_log file?
I got the following error
Running CentOS 5.5
Transaction Check Error:
file /etc/my.cnf from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/czech/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/dutch/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/english/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/estonian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/french/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/german/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/greek/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/italian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/japanese/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/korean/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/polish/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/romanian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/russian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/serbian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/slovak/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/spanish/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/swedish/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.x86_64
file /etc/my.cnf from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/czech/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/danish/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/dutch/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/english/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/estonian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/french/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/german/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/greek/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/italian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/japanese/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/korean/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/polish/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/romanian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/russian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/serbian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/slovak/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/spanish/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/swedish/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-libs-5.1.54-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
Hi Hoddie54,
Try update MySQL with following command:
And then try installation again…
Trying to install MySql on RHEL 5.5, I get the following when I run “yum –enablerepo=remi install mysql mysql-server”:
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package mysql.x86_64 0:5.1.55-1.el5.remi set to be updated
–> Processing Dependency: mysql-libs = 5.1.55-1.el5.remi for package: mysql
–> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: mysql
–> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: mysql
–> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mysql
–> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: mysql
—> Package mysql-server.x86_64 0:5.1.55-1.el5.remi set to be updated
–> Processing Dependency: perl-DBD-MySQL for package: mysql-server
–> Running transaction check
—> Package mysql-libs.x86_64 0:5.1.55-1.el5.remi set to be updated
—> Package mysql-server.x86_64 0:5.1.55-1.el5.remi set to be updated
–> Processing Dependency: perl-DBD-MySQL for package: mysql-server
–> Finished Dependency Resolution
mysql-server-5.1.55-1.el5.remi.x86_64 from remi has depsolving problems
–> Missing Dependency: perl-DBD-MySQL is needed by package mysql-server-5.1.55-1.el5.remi.x86_64 (remi)
Error: Missing Dependency: perl-DBD-MySQL is needed by package mysql-server-5.1.55-1.el5.remi.x86_64 (remi)
You could try using –skip-broken to work around the problem
You could try running: package-cleanup –problems
package-cleanup –dupes
rpm -Va –nofiles –nodigest
The program package-cleanup is found in the yum-utils package.
#
Any advice or help to offer so I can get mysql running?
Hi sebastiang,
Try following:
What is output?
Hi JR,
I get similar error to what sebastian gets when I tried to install php.
I am using rhel 6 stable/newer version. Apache and mysql servers are installed.
When I tried yum enablerepo remi search php
it lists php but when I tried to install php with the command yum enablerepo remi install php
it gives me an error.
Any information on this?
Shank
Hi shashank,
Btw, you could update your remi repo to RHEL 6 version with following command:
Then try again. And please post error messages what you get on installation?
I added this Remi RHEL 6 repo also to guide.
Hi JR,
Yes, I updated the remi with version 6 when I checked the figured it out and installed it from the remi repository.
I resolved my issue by updating mysql with the version I downloaded one from remi. When I replaced the rhel 6 version mysql with remi version…My php-common libcurl.so:3 error went away and I was able to install php.
Thank you for the tutorial. It was really helpful.
Shank
Hi JR.
I am trying to install php-imap on the remi release.
But run against some issues, and i am not that expert. Can you help me to solve this issue.
Thanks.
Resolving Dependencies
–> Running transaction check
—> Package php-imap.x86_64 0:5.1.6-27.el5_5.3 set to be updated
–> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php-imap
–> Processing Dependency: libc-client.so.1()(64bit) for package: php-imap
–> Running transaction check
—> Package libc-client.x86_64 0:2004g-2.2.1 set to be updated
—> Package php-imap.x86_64 0:5.1.6-27.el5_5.3 set to be updated
–> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php-imap
–> Finished Dependency Resolution
php-imap-5.1.6-27.el5_5.3.x86_64 from updates has depsolving problems
–> Missing Dependency: php-common = 5.1.6-27.el5_5.3 is needed by package php-imap-5.1.6-27.el5_5.3.x86_64 (updates)
Error: Missing Dependency: php-common = 5.1.6-27.el5_5.3 is needed by package php-imap-5.1.6-27.el5_5.3.x86_64 (updates)
You could try using –skip-broken to work around the problem
You could try running: package-cleanup –problems
package-cleanup –dupes
rpm -Va –nofiles –nodigest
Hi Marco,
Could you post output of following command:
I followed the instructions to add the new repositories but here’s what I get:
# yum –enablerepo=remi install httpd php
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirrors.versaweb.com
* base: mirrors.usc.edu
* epel: mirrors.solfo.com
* extras: centos.promopeddler.com
* remi: iut-info.univ-reims.fr
* updates: mirror.5ninesolutions.com
Excluding Packages in global exclude list
Finished
Setting up Install Process
No package httpd available.
No package php available.
Nothing to do
I’m using CentOS 5.5 — do you have any idea why this isn’t working
Hi Blair,
First is good to know what is in your global exclude list?
Sorry, Im a newbie in this… I’m trying to install Apache following your guide but I gotta error message after adding the instruction of
Adding following line before COMMIT:
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
After restart the iptables I gotta the following error message
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: iptables-restore: line 13 failed [FAILED]
And I’d no access to the file test.php through the browser.
Some ideas?
Thanx in advance.
Adding the folowing line below “:OUTPUT ACCEPT [0:0]” seems to remove the error:
:RH-Firewall-1-INPUT - [0:0]
I gotta say I actually can see the test.php but the rule in the firewall launches till the error.
When i try to create a PHP test page, i just got blank page??
Hi Ar,
Do you get any errors on /var/log/httpd/error_log or any SELinux warnings?
I am getting the following errors :
It happens when trying to install the php-mysql (that i need a *lot*) :P
thanks!
Hi tiagoh,
Did you setup remi repository?
And did you enabled it when you trying to install php-mysql?
who can install httpd on fedora 15, without yum
Hi kreshan,
So do you want to install httpd without yum on Fedora 15?
remove old version before..
yum remove php php-common