Install Apache/PHP 5.5.11 on Fedora 20/19, CentOS/RHEL 6.5/5.10

This guide shows howto install Apache HTTP Server (httpd) with PHP 5.5.11 and following modules on Fedora 20/19/18/17, CentOS 6.5/6.4/6.3/6.2/6.1/6/5.10 and Red Hat (RHEL) 6.5/6.4/6.3/6.2/6.1/6/5.10 systems.

  • APC (php-pecl-apc) – APC caches and optimizes PHP intermediate code
  • 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 (php-pecl-mongo) – PHP MongoDB database driver
  • SQLite (php-sqlite) – Extension for the SQLite V2 Embeddable SQL Database Engine
  • Memcache (php-pecl-memcache) – Extension to work with the Memcached caching daemon
  • Memcached (php-pecl-memcached) – Extension to work with the Memcached caching daemon
  • GD (php-gd) – A module for PHP applications for using the gd graphics library
  • XML (php-xml) – A module for PHP applications which use XML
  • MBString (php-mbstring) – A module for PHP applications which need multi-byte string handling
  • MCrypt (php-mcrypt) – Standard PHP module provides mcrypt library support

Install Apache HTTP Server (httpd) and PHP 5.5.11 on Fedora 20/19/18/17, CentOS / Red Hat (RHEL) 6.5/5.10

1. Change root user

su -
## OR ##
sudo -i

2. Install Remi repository

Fedora

## Remi Dependency on Fedora 20 / 19 / 18 / 17 ##
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm 
rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
 
## Fedora 20 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-20.rpm
 
## Fedora 19 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-19.rpm
 
## Fedora 18 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-18.rpm
 
## Fedora 17 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-17.rpm

CentOS and Red Hat (RHEL)

## Remi Dependency on CentOS 6 and Red Hat (RHEL) 6 ##
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
 
## CentOS 6 and Red Hat (RHEL) 6 ##
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
 
 
## Remi Dependency on CentOS 5 and Red Hat (RHEL) 5 ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
 
## CentOS 5 and Red Hat (RHEL) 5 ## 
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

3. Install Apache (httpd) Web server and PHP 5.5.11

Fedora 20/19

yum --enablerepo=remi install httpd php php-common

Fedora 18/17

yum --enablerepo=remi,remi-test install httpd php php-common

CentOS 6.5/5.10 and Red Hat (RHEL) 6.5/5.10

yum --enablerepo=remi,remi-php55 install httpd php php-common

4. Install PHP 5.5.11 modules

Select what you need: APC, CLI, PEAR, PDO, MySQL, PostgreSQL, MongoDB, SQLite, Memcache, Memcached, GD, MBString, MCrypt, XML

More info about PHP APC from PHP APC Configuration and Usage Tips and Tricks.

Fedora 20/19

yum --enablerepo=remi install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml

Fedora 18/17

yum --enablerepo=remi,remi-test install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml

CentOS 6.5/5.10 and Red Hat (RHEL) 6.5/5.10

yum --enablerepo=remi,remi-php55 install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml

5. Start Apache HTTP server (httpd) and autostart Apache HTTP server (httpd) on boot

/etc/init.d/httpd start ## use restart after update
## OR ##
service httpd start ## use restart after update
 
## Fedora ##
systemctl enable httpd.service
 
## CentOS / RHEL ##
chkconfig --levels 235 httpd on

6. Create test PHP page to check that Apache, PHP and PHP modules are working

Add following content to /var/www/html/test.php file.

<?php
 
    phpinfo();

7. Check created page with browser

Access following address, with your browser. http://localhost/test.php
Fedora 19 Running Apache and PHP 5.5.0

Enable Remote Connection to Apache HTTP Server (httpd) –> Open Web server Port (80) on Iptables Firewall (as root user again)

1. CentOS/Red Hat (RHEL)

1.1 Edit /etc/sysconfig/iptables file:

nano -w /etc/sysconfig/iptables

1.2 Add following INPUT rule:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

1.3 Restart Iptables Firewall:

service iptables restart
## OR ##
/etc/init.d/iptables restart

2. Fedora

2.1 Add New Rule to Firewalld

firewall-cmd --permanent --zone=public --add-service=http
 
## OR ##
 
firewall-cmd --permanent --zone=public --add --port=80/tcp

2.2 Restart Iptables

systemctl restart iptables.service

3. Test remote connection

Access following address, with your browser. http://your.domain/test.php

More reading:

Enable Apache Userdir with SELinux on Fedora 19/18/17, CentOS 6.4/6.3/6.2/6.1/6/5.9, Red Hat (RHEL) 6.4/6.3/6.2/6.1/6/5.9 >>

Follow If Not True Then False Updates!

210 Comments

  1. [root@phi umar]# /etc/init.d/httpd restart
    Restarting httpd (via systemctl): Job failed. See system logs and ‘systemctl status’ for details.
    [FAILED]

    Help Please!

    • Hi UZ,

      Try following instead:

      service httpd restart
  2. Hello JR,

    [root@phi umar]# service httpd restart
    Restarting httpd (via systemctl): Job failed. See system logs and ‘systemctl status’ for details.
    [FAILED]
  3. [root@phi umar]# service httpd restart
    Restarting httpd (via systemctl): Job failed. See system logs and ‘systemctl status’ for details.
    [FAILED]

    • Hi again UZ,

      Could you post output of following commands:

      systemctl status httpd.service
       
      cat /var/log/messages | grep httpd
       
      httpd -t
       
      tail -n 150 /var/log/httpd/error_log
  4. Hi, I’ve use the command as follow: yum --enablerepo=remi install httpd php php-common so PHP 5.3.17 was installed instead of 5.4.7. It’s possible to upgrade from 5.3.17 to 5.4.7 without mess the system? How?
    Thanks

    • Hi ReynierPM,

      Following should work:

      yum --enablerepo=remi,remi-test update httpd php php-common
       
      service httpd restart

      You should also make sure that you update also all PHP modules and all your PHP scripts should work with PHP 5.4. Best and safest method is backup your system before update and test this change on test server or some virtual machine.

  5. If it is not working as you expect, just do yum downgrade php* and all will be set to working stock versions.

  6. if i use this cmd: yum --enablerepo=remi,remi-test install php-pecl-apc php-cli php-pear php-pdo php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
    come this why?

    http://www.upload.ee/image/2768958/Untitled.png

    • Hi tarmo,

      You have conflict between your current MySQL 5.0.95 installation and remi repo php-mysql (mysql-libs) 5.5.28 packages.

  7. Hi,

    When i try to update the php, this error show:-

    Error: Package: php-gd-5.4.9-1.el6.remi.x86_64 (remi-test)
    Requires: libt1.so.5()(64bit)

    • Hi Faisal,

      Could you post output of following commands:

      yum list installed t1lib
       
      ls -la /usr/lib64/libt1.*
       
      uname -a
       
      lsb_release -a
  8. i get this error :

    Error unpacking rpm package php-common-5.4.10-1.el5.remi.i386
    warning: /etc/php.ini created as /etc/php.ini.rpmnew
    error: unpacking of archive failed on file /usr/lib/php: cpio: chown

    • Hi joe,

      Could you post output of following commands:

      df
       
      free
  9. Everything always posts when they have problems.. Everything worked fine for me on CentOS 6.3 x86_64. This saved me some time, thanks!

  10. Thanks for this, worked great. I was having problems previously with permissions and the GD library so I wiped and used this as a clean install.

    My only issue now is that mod_rewrite doesn’t seem to work properly. An existing wordpress install I had gives me 404′s when I follow any of the “pretty permalinks”. When I change them back to query strings, they work just fine.

    I checked httpd.conf and the module is imported. I refreshed the permalink settings in WordPress and made sure the .htaccess file was writeable by the server. The rewrite rules are in the .htaccess file properly. Any ideas?

    Thanks!

    • Fixed!

      Had to change AllowOverride from None to All under .

      Thanks again for this great guide. I’ll be coming back here often.

  11. Dear JR
    I followed the steps but got the error

    [root@localhost conf.d]# service httpd restart
    Restarting httpd (via systemctl): Job failed. See system logs and ‘systemctl status’ for details.
    [FAILED]

    [root@localhost conf.d]# systemctl status httpd.service
    httpd.service – LSB: start and stop Apache HTTP Server
    Loaded: loaded (/etc/rc.d/init.d/httpd)
    Active: failed since Thu, 31 Jan 2013 20:04:28 +0530; 52s ago
    Process: 22198 ExecStart=/etc/rc.d/init.d/httpd start (code=exited, status=1/FAILURE)
    Main PID: 30487 (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/httpd.service

    [root@localhost conf.d]# httpd -t
    Syntax OK

    [root@localhost conf.d]# cat /var/log/messages | grep httpd
    Jan 31 20:03:43 localhost systemd[1]: httpd.service: control process exited, code=exited status=1
    Jan 31 20:03:43 localhost systemd[1]: Unit httpd.service entered failed state.
    Jan 31 20:04:28 localhost systemd[1]: httpd.service: control process exited, code=exited status=1
    Jan 31 20:04:28 localhost systemd[1]: Unit httpd.service entered failed state.
    Jan 31 20:05:44 localhost systemd[1]: httpd.service: control process exited, code=exited status=1
    Jan 31 20:05:44 localhost systemd[1]: Unit httpd.service entered failed state.

    Please help

    • Hi Priyabrata,

      Could you also post output of following commands:

      cat /var/log/httpd/error_log
       
      lsb_release -a
       
      uname -a
      • [root@localhost Test30Jan2013]# ll /var/log/httpd/
        total 20
        -rw-r–r–. 1 root root 0 Dec 11 2011 access_log
        -rw-r–r–. 1 root root 1749 Dec 6 2011 access_log-20111211
        -rw-r–r–. 1 root root 0 Jan 26 03:16 error_log
        -rw-r–r–. 1 root root 1723 Dec 11 2011 error_log-20111211
        -rw-r–r–. 1 root root 958 Jan 31 19:08 error_log-20130126
        -rw-r–r–. 1 root root 0 Dec 6 2011 ssl_access_log
        -rw-r–r–. 1 root root 0 Jan 26 03:16 ssl_error_log
        -rw-r–r–. 1 root root 258 Dec 6 2011 ssl_error_log-20111211
        -rw-r–r–. 1 root root 258 Jan 25 17:21 ssl_error_log-20130126
        -rw-r–r–. 1 root root 0 Dec 6 2011 ssl_request_log

        ###############
        cat /var/log/httpd/error_log: Empty file, nothing is written

        ################
        [root@localhost Test30Jan2013]# lsb_release -a
        LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch
        Distributor ID: Fedora
        Description: Fedora release 15 (Lovelock)
        Release: 15
        Codename: Lovelock

        ##################
        [root@localhost Test30Jan2013]# uname -a
        Linux localhost.localdomain 2.6.43.8-1.fc15.x86_64 #1 SMP Mon Jun 4 20:33:44 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

        • Thanks, then use following to get older log entries:

          cat /var/log/httpd/error_log*

          And check also syntax errors:

          httpd -t
          • [root@localhost Test30Jan2013]# httpd -t
            Syntax OK

            ########## Sorry for lengthy output ###########

            [root@localhost Test30Jan2013]# cat /var/log/httpd/error_log*
            [Tue Dec 06 14:48:39 2011] [notice] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
            [Tue Dec 06 14:48:39 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
            [Tue Dec 06 14:48:39 2011] [notice] SSL FIPS mode disabled
            [Tue Dec 06 14:48:39 2011] [notice] Digest: generating secret for digest authentication …
            [Tue Dec 06 14:48:39 2011] [notice] Digest: done
            [Tue Dec 06 14:48:39 2011] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
            [Tue Dec 06 14:48:39 2011] [notice] mod_python: using mutex_directory /tmp
            [Tue Dec 06 14:48:40 2011] [notice] SSL FIPS mode disabled
            [Tue Dec 06 14:48:40 2011] [notice] Apache/2.2.21 (Unix) DAV/2 PHP/5.3.8 mod_python/3.3.1 Python/2.7.1 mod_ssl/2.2.21 OpenSSL/1.0.0e-fips mod_perl/2.0.4 Perl/v5.12.4 configured — resuming normal operations
            [Tue Dec 06 14:48:53 2011] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
            [Tue Dec 06 14:48:53 2011] [error] [client ::1] File does not exist: /var/www/html/favicon.ico
            [Tue Dec 06 14:48:53 2011] [error] [client ::1] File does not exist: /var/www/html/favicon.ico
            [Tue Dec 06 14:51:49 2011] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
            [Tue Dec 06 14:52:29 2011] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
            [Tue Dec 06 14:52:36 2011] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
            [Sun Dec 11 03:38:03 2011] [notice] SIGHUP received. Attempting to restart
            (98)Address already in use: make_sock: could not bind to address 172.16.49.47:80
            no listening sockets available, shutting down
            Unable to open logs
            [Fri Jan 25 17:21:17 2013] [notice] SELinux policy enabled; httpd running as context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
            [Fri Jan 25 17:21:17 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
            [Fri Jan 25 17:21:17 2013] [notice] SSL FIPS mode disabled
            [Fri Jan 25 17:21:17 2013] [notice] Digest: generating secret for digest authentication …
            [Fri Jan 25 17:21:17 2013] [notice] Digest: done
            [Fri Jan 25 17:21:17 2013] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
            [Fri Jan 25 17:21:17 2013] [notice] mod_python: using mutex_directory /tmp
            [Fri Jan 25 17:21:17 2013] [notice] SSL FIPS mode disabled
            [Fri Jan 25 17:21:18 2013] [notice] Apache/2.2.22 (Unix) DAV/2 PHP/5.3.13 mod_python/3.3.1 Python/2.7.1 mod_ssl/2.2.22 OpenSSL/1.0.0j-fips mod_perl/2.0.4 Perl/v5.12.4 configured — resuming normal operations
            [Thu Jan 31 19:08:55 2013] [notice] caught SIGTERM, shutting down

            • Thanks Priyabrata,

              First thing what I noticed is:
              (98)Address already in use: make_sock: could not bind to address 172.16.49.47:80

              Do you have some other server/service running on port 80?

              • Dear JR

                The problem was sorted out. Actually I had installed Apache latest version with –prefix option and where I have configured for 172.16.49.47:80. This new installation was conflicting with the default httpd conf file at /etc/httpd/conf/http.conf.

                I deleted the newly installed apache, restarted the server. It worked fine now.

                Dear JR, Thanks for your nice blog, time and ur patience. Really thanks :)

                Now my next task is to configure mysql and php. In this regard if I may face any problem then reply u.

                • Hi again Priyabrata,

                  Excellent to hear that you got it working! :)

                  And thanks for the compliments! You are very welcome! :)

                  Did you get mysql and php up and running?

  12. I installed apache on fedora 18 x86_64, but when I started the service I had some error on config files:


    [root@localhost conf.d]# service httpd start
    Redirecting to /bin/systemctl start httpd.service
    Job for httpd.service failed. See ‘systemctl status httpd.service’ and ‘journalctl -xn’ for details.

    [root@localhost conf.d]# systemctl status httpd.service
    httpd.service – The Apache HTTP Server
    Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
    Active: failed (Result: exit-code) since mer 2013-02-06 14:39:48 CET; 1min 55s ago
    Process: 14515 ExecStop=/usr/sbin/httpd $OPTIONS -k graceful-stop (code=exited, status=1/FAILURE)
    Process: 14513 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
    Status: “Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec”

    feb 06 14:39:48 localhost.localdomain systemd[1]: Starting The Apache HTTP Server…
    feb 06 14:39:48 localhost.localdomain httpd[14513]: httpd: Syntax error on line 351 of /etc/httpd/conf/httpd.conf: Syntax error on line 140 of /etc/httpd/conf.d/system-config-httpd.conf: /etc/httpd/conf.d/system-config-httpd.conf:146: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:144: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:142: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:140: was not closed.
    feb 06 14:39:48 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
    feb 06 14:39:48 localhost.localdomain httpd[14515]: httpd: Syntax error on line 351 of /etc/httpd/conf/httpd.conf: Syntax error on line 140 of /etc/httpd/conf.d/system-config-httpd.conf: /etc/httpd/conf.d/system-config-httpd.conf:146: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:144: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:142: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:140: was not closed.
    feb 06 14:39:48 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
    feb 06 14:39:48 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
    feb 06 14:39:48 localhost.localdomain systemd[1]: Unit httpd.service entered failed state

    Can you help me please?

    • Hi Bruno,

      Check this:

      feb 06 14:39:48 localhost.localdomain httpd[14513]: httpd: Syntax error on line 351 of /etc/httpd/conf/httpd.conf: Syntax error on line 140 of /etc/httpd/conf.d/system-config-httpd.conf: /etc/httpd/conf.d/system-config-httpd.conf:146: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:144: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:142: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:140: was not closed.

      Looks like you have some syntax error on your httpd.conf file.

      Try to run:

      httpd -t

      And fix error and then try start httpd again.

      • Hi HR,
        I tried, this is the output:


        [root@localhost ~]# httpd
        httpd: Syntax error on line 351 of /etc/httpd/conf/httpd.conf: Syntax error on line 137 of /etc/httpd/conf.d/system-config-httpd.conf: /etc/httpd/conf.d/system-config-httpd.conf:143: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:141: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:139: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:137: was not closed.
        [root@localhost ~]# httpd -t
        httpd: Syntax error on line 351 of /etc/httpd/conf/httpd.conf: Syntax error on line 137 of /etc/httpd/conf.d/system-config-httpd.conf: /etc/httpd/conf.d/system-config-httpd.conf:143: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:141: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:139: was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:137: was not closed.
        [root@localhost ~]# tail -20 /etc/httpd/conf.d/system-config-httpd.conf
        # Each directory to which Apache has access can be configured with respect
        # to which services and features are allowed and/or disabled in that
        # directory (and its subdirectories).
        #
        # Note that from this point forward you must specifically allow
        # particular features to be enabled – so if something’s not working as
        # you might expect, make sure that you have specifically enabled it
        # below.
        #

        Options FollowSymLinksAllowOverride None

        Options Indexes Includes FollowSymLinksAllowOverride NoneAllow from allOrder allow,deny

        Options Indexes MultiViewsAllowOverride NoneAllow from allOrder allow,deny

        Options ExecCGIAllowOverride NoneAllow from allOrder allow,deny

        [root@localhost ~]#

        I don’t understand what kind of error is was not closed. so I don’t how to fix.
        I tried to comment these lines and apache start without errors but doesn’t work.

        • Sorry, the previous output is no readable becouse the characters < and > are recoded.
          The error that I don’t understand is:

          <Directory> is not closed.

          The error lines are in /etc/httpd/conf.d/system-config-httpd.conf , and the error lines are thease:


          <Directory “/”>
          Options FollowSymLinksAllowOverride None</Directory>
          <Directory “/var/www/html”>
          Options Indexes Includes FollowSymLinksAllowOverride NoneAllow from allOrder allow,deny</Directory>
          <Directory “/var/www/icons”>
          Options Indexes MultiViewsAllowOverride NoneAllow from allOrder allow,deny</Directory>
          <Directory “/var/www/cgi-bin”>
          Options ExecCGIAllowOverride NoneAllow from allOrder allow,deny</Directory>

          • Hi Bruno,

            This conf looks good, but is there somewhere near this, some <directory> element which is not closed?

            Could you paste all of your config files example to http://pastebin.com ?

            • Hi HR,
              I put the tarball of /etc/httpd directory in google drive:

              https://docs.google.com/file/d/0Bxuknh8WR68bcW9xM3FLLTB4UFk/edit?usp=sharing

              • I checked your config and check following part:

                # Virtual host Default Virtual Host<VirtualHost *>
                 	ServerSignature emailDirectoryIndex  index.php index.html index.htm index.shtmlLogLevel  warnHostNameLookups off</VirtualHost>
                 
                 
                #
                # Each directory to which Apache has access can be configured with respect
                # to which services and features are allowed and/or disabled in that
                # directory (and its subdirectories). 
                #
                # Note that from this point forward you must specifically allow
                # particular features to be enabled - so if something's not working as
                # you might expect, make sure that you have specifically enabled it
                # below.
                #
                <Directory "/">
                        Options FollowSymLinksAllowOverride None</Directory>
                <Directory "/var/www/html">
                        Options Indexes Includes FollowSymLinksAllowOverride NoneAllow from allOrder allow,deny</Directory>
                <Directory "/var/www/icons">
                        Options Indexes MultiViewsAllowOverride NoneAllow from allOrder allow,deny</Directory>
                <Directory "/var/www/cgi-bin">
                        Options ExecCGIAllowOverride NoneAllow from allOrder allow,deny</Directory>

                It should look something like:

                # Virtual host Default Virtual Host
                <VirtualHost *>
                 	ServerSignature email
                 	DirectoryIndex  index.php index.html index.htm index.shtml
                 	LogLevel  warn
                 	HostNameLookups off
                </VirtualHost>
                 
                 
                #
                # Each directory to which Apache has access can be configured with respect
                # to which services and features are allowed and/or disabled in that
                # directory (and its subdirectories). 
                #
                # Note that from this point forward you must specifically allow
                # particular features to be enabled - so if something's not working as
                # you might expect, make sure that you have specifically enabled it
                # below.
                #
                <Directory "/">
                        Options FollowSymLinks
                 	AllowOverride None
                </Directory>
                <Directory "/var/www/html">
                        Options Indexes Includes FollowSymLinks
                 	AllowOverride None
                 	Allow from all
                 	Order allow,deny
                </Directory>
                <Directory "/var/www/icons">
                        Options Indexes MultiViews
                 	AllowOverride None
                 	Allow from all
                 	Order allow,deny
                </Directory>
                <Directory "/var/www/cgi-bin">
                        Options ExecCGI
                 	AllowOverride None
                 	Allow from all
                 	Order allow,deny
                </Directory>

                So you are missing line breaks or have some problem with those.

                • Thank you for your correction!
                  Now the service start, but doesn’t work.
                  The status of service is this:


                  [root@tron httpd]# service httpd status
                  Redirecting to /bin/systemctl status httpd.service
                  httpd.service – The Apache HTTP Server
                  Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
                  Active: active (running) since mar 2013-02-19 10:31:36 CET; 4min 56s ago
                  Process: 2845 ExecStop=/usr/sbin/httpd $OPTIONS -k graceful-stop (code=exited, status=1/FAILURE)
                  Main PID: 3070 (httpd)
                  Status: “Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec”
                  CGroup: name=systemd:/system/httpd.service
                  ├─3070 /usr/sbin/httpd -DFOREGROUND
                  ├─3072 /usr/sbin/httpd -DFOREGROUND
                  ├─3073 /usr/sbin/httpd -DFOREGROUND
                  ├─3074 /usr/sbin/httpd -DFOREGROUND
                  ├─3075 /usr/sbin/httpd -DFOREGROUND
                  ├─3076 /usr/sbin/httpd -DFOREGROUND
                  ├─3077 /usr/sbin/httpd -DFOREGROUND
                  ├─3078 /usr/sbin/httpd -DFOREGROUND
                  └─3079 /usr/sbin/httpd -DFOREGROUND

                  feb 19 10:31:36 tron.domus systemd[1]: Started The Apache HTTP Server.

                  I found some messages in /var/log/httpd/error_log:


                  [root@tron httpd]# cat error_log
                  [Tue Feb 19 10:31:34.079365 2013] [core:notice] [pid 3070] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
                  [Tue Feb 19 10:31:34.093751 2013] [suexec:notice] [pid 3070] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
                  [Tue Feb 19 10:31:35.024704 2013] [auth_digest:notice] [pid 3070] AH01757: generating secret for digest authentication …
                  [Tue Feb 19 10:31:36.000844 2013] [lbmethod_heartbeat:notice] [pid 3070] AH02282: No slotmem from mod_heartmonitor
                  [Tue Feb 19 10:31:36.508975 2013] [mpm_prefork:notice] [pid 3070] AH00163: Apache/2.4.3 (Fedora) PHP/5.4.11 configured — resuming normal operations
                  [Tue Feb 19 10:31:36.509008 2013] [core:notice] [pid 3070] AH00094: Command line: ‘/usr/sbin/httpd -D FOREGROUND’

                  What do you think about this?

                  • Do you use heartbeat?

                    • No, I don’t.

                    • Try following (as root):

                      cd /etc/httpd/conf.modules.d
                       
                      mv 00-proxy.conf 00-proxy.bak
                       
                      service httpd restart
                • I had exactly this same problem with Fedora 18. Looks like the default system-config-httpd.conf file has a problem with missing line breaks??

  13. I have developed a web server using Apache,Php. I am very new to this field. Although I have developed the server but my concern is the secuirity. I am not sure whether I have developed a secured server or not? Kindly suggest me.

    What my server does
    ———————–
    I have set of files (about 80,000) stored in /var/www/pdb folder. User will give the name of file and I have written some R-scripts (about 10-15) which will parse that file and generates some output, which I have to give back to the user.

    So I had separately kept All database files in /var/www/pdb, all my R-scripts in /var/www/SASMAT. My front-end webpage is /var/www/html/SASMAT.html. Upon input of filename and submit, the action is to call a Php script “upload.php” which fetch user inputs and calls R-script with the input as command line arguments. I have separated the Php script from R-script and kept under /var/www/cgi-bin

    ### Action of form submission is to call upload.php

    ### Php script calls R-script by passing $_POST["pdbid"] as comamdn line args
    $url=’/usr/bin/Rscript /var/www/SASMAT/pipeline.r ‘ . $_POST["pdbid"];
    exec($url,$x);

    ### What R-script does
    1) Copies the filename ($_POST["pdbid"]) from /var/www/pdb to /var/www/upload
    2) Set the working directory to /var/www/upload
    3) Parse the files and generates many outputs
    4) Moves the output files from /var/www/upload back to /var/www/html so that I can give as output.

    Summarizing each folder
    ————————-
    1) My source files (appx 80000 files) : /var/www/pdb
    2) My all R-scripts (appx 10-15 scripts): /var/www/SASMAT
    3) My working directory: /var/www/upload where all parsing stuffs will go
    4) My main output directory: /var/www/html

    What I want
    ———–
    1) User should not access to SASMAT, upload, cgi-bin, pdb.
    2) User only have access to /var/www/html folder.

    ll /var/www
    drwxr-xr-x. 2 manas manas 4096 Feb 18 19:26 cgi-bin
    drwxr-xr-x. 3 manas manas 4096 Oct 31 21:55 error
    drwxr-xrwx. 3 manas manas 4096 Feb 19 17:44 html
    drwxr-xr-x. 3 manas manas 4096 Feb 13 19:28 icons
    drwxrwxrwx 2 apache apache 4096 Feb 19 14:17 pdb
    drwxrwxr-x 2 manas manas 4096 Feb 13 19:29 plots
    drwxrwxr-x 2 manas manas 4096 Feb 19 15:52 SASMAT
    drwxrwxrwx 2 manas manas 4096 Feb 19 17:42 upload

    Currently when user types http://www.example.com/cgi-bin/upload.php: It executes the upload.php which I dont want. I want to restrict the user to use the php scripts directly.

    I am sorry for this lengthy post but I had to.

    • Sorry that at the end the url http://www.example.com/cgi-bin/upload.php is just I had given as examplt. Not the true link

      • Priyabrata,

        First you should add to your upload.php some check that this request is post request.

        Real thing what you can do is post some unique one time hash, which is generated from user data or something else, like timestamp+salt which is saved database and added to form.

        This is just idea:
        1. Generate hash and add it to db
        2. Add this hash to form
        3. Check hash (on upload.php) from $_POST that matches hash in db
        4. Remove hash from db

        Now when someone use your form, upload.php checks first that request is $_POST and then verify hash before doing anything. I think that this is secure enough for most cases. :)

        • Dear JR
          Thanks for nice suggestion. Apart from this as I mentioned how can I make the cgi-bin (All php scripts) not access by client.

          Lets assume my server is http://myip.com/index.html
          upon submit it calls upload.php
          “”

          When user view the source code of my index.html, he can easily see the form action i.e. “../cgi-bin/upload.php”.

          Then by using this knowledge if he types the url http://myip.com/cgi-bin/upload.php, it executes the script.

          Actually I have other php scripts in cgi-bin, for example clean.php which cleans all output files. If user types http://myip.com/cgi-bin/clean.php, it will clean my output files.

          I want to restrict the direct access. Please give ur suggestion in this respect also.

          • Hi Priyabrata,

            You can restrict direct access using httpd conf file or .htaccess and deny access to cgi-bin or selected files, but then those files are accessible only from localhost or specific IP addresses, like:

            <Files *>
                Order Deny,Allow 
                Allow from 127.0.0.1 192.168.0.1
                Deny from all
            </Files>

            So then you can example call your scripts from localhost, but not from public Internet.

            If you really want restrict the direct access, then your users can’t really use your scripts, even they use your form. So then you need another public script which calls example your upload.php and then situation is same, someone could use this script directly and do same thing. So if you want let your users use your scripts then you need something public anyways. And if you want public and protected scripts then you will need some more sophisticated logic than just restrict direct access.

  14. When installing php from remi I keep on getting this error

    Error: Package: php-gd-5.4.12-1.el6.remi.i686 (remi)
    Requires: libt1.so.5

    Running a 32bit rhel 6.3

    Thanks for any pointers on where to go, want to get phpmyadmin running.

    Frank

    • Hi Frank,

      Could you post output of following command:

      yum list available |grep t1lib
      • Hi JR,

        [root@rxxxx ~]# yum list available |grep t1lib
        [root@rxxxx ~]#

        nothing comes out…
        Thanks,
        F.

        • Hi Frank,

          Do you have RHEL Subscription?

          • Hi JR,

            Yes I do.

          • So I enabled the subscription and after installing every thing, I now get: 403 Forbidden You don’t have permission to access /phpmyadmin/ on this server,
            was the install not supposed to also set phpmyadmin to run?
            Thanks,
            F.

            • Hi Frank,

              I’m not sure which is your current setup, but you can check phpMyAdmin install guide for more information.

              • Hi JR,

                Thanks for the help, the issue was in phpMyAdmin.conf, I commented out of

                Require local
                #Order Deny,Allow
                #Deny from All
                Allow from 127.0.0.1
                Allow from ::1

                Frank

                • You are welcome! And nice to hear that you got it working!

  15. Hello,

    I’m getting in trouble when trying to install the following modules :
    yum –enablerepo=remi,remi-test install php-pecl-memcached php-mcrypt

    I receive message from yum complaining about compatibilities :
    –> Finished Dependency Resolution
    Error: Package: php-pecl-memcached-1.0.0-1.el6.x86_64 (epel)
    Requires: php(api) = 20090626
    Installed: php-common-5.4.12-1.el6.remi.x86_64 (@remi)
    php(api) = 20100412-x86-64
    Available: php-common-5.3.3-3.el6_2.8.x86_64 (base)
    php(api) = 20090626
    Available: php-common-5.3.3-14.el6_3.x86_64 (updates)
    php(api) = 20090626
    Available: php-common-5.4.11-1.el6.remi.x86_64 (remi)
    php(api) = 20100412-x86-64
    Error: Package: php-pecl-memcached-1.0.0-1.el6.x86_64 (epel)
    Requires: php(zend-abi) = 20090626
    Installed: php-common-5.4.12-1.el6.remi.x86_64 (@remi)
    php(zend-abi) = 20100525-x86-64
    Available: php-common-5.3.3-3.el6_2.8.x86_64 (base)
    php(zend-abi) = 20090626
    Available: php-common-5.3.3-14.el6_3.x86_64 (updates)
    php(zend-abi) = 20090626
    Available: php-common-5.4.11-1.el6.remi.x86_64 (remi)
    php(zend-abi) = 20100525-x86-64
    Error: Package: php-mcrypt-5.3.3-1.el6.x86_64 (epel)
    Requires: php-api = 20090626
    Installed: php-common-5.4.12-1.el6.remi.x86_64 (@remi)
    php-api = 20100412-x86-64
    Available: php-common-5.3.3-3.el6_2.8.x86_64 (base)
    php-api = 20090626
    Available: php-common-5.3.3-14.el6_3.x86_64 (updates)
    php-api = 20090626
    Available: php-common-5.4.11-1.el6.remi.x86_64 (remi)
    php-api = 20100412-x86-64

    Sorry, but despite googling this, no result or ways to resolve this !

    Any idea ?

    Regards,

    Laurent

    • Try following command instead:

      yum --enablerepo=remi,remi-test --disablerepo=epel install php-pecl-memcached php-mcrypt

      If it’s not working, could you post error messages then and output of following command:

      rpm -qa php\*
  16. Thanks. It helped me a lot.

  17. why use the famillecollet repos?

    • Hi Padraic,

      You can use of course some other repos too. If you use Fedora 19, then you can use updates repo, but many times Remi repo builds arrives earlier than Fedora 19 builds. Anyway you need some external repo with RHEL / CentOS / < Fedora 19.

  18. Installed PHP 5.5 on a CentOS 6.3 box. When I try start httpd with “service httpd start” it fails, however if I call “httpd” directly it starts fine. Any idea what could be causing this?

    • Hi Jonathan,

      Could you check httpd error log, if there is little bit more information why it’s fails?

  19. I have IIS & Xampp with different port
    IIS :80 & XAMPP :8080
    I’m cannot access localhost:8080 rediect to IIS localhost:80

    • Hi Nurul Imam,

      What operating system you are using?

  20. I followed all the steps for installing php but I get a blank test page. I am running Fedora 19. Please let me know what further information you need in order to help. Thanks.

  21. I reloaded my VPS and followed this guide again and it installed php 5.5.6 and there seems to me a problem with it because i will get this in my error log like every 10 seconds and apache would not work:

    [error] (12)Cannot allocate memory: fork: Unable to fork new process

    is there any way to install php 5.5.5 and not 5.5.6? I have another 2 VPS that i configured using this guide like a week ago when the latest php version was 5.5.5 and they work just fine.

    • Hi Lautaro,

      PHP 5.5.5 is still available on Remi repository, so you can downgrade your PHP, something like:

      yum --enablerepo=remi,remi-php55 downgrade php
       
      ## OR ##
       
      yum --enablerepo=remi,remi-php55 downgrade php\*

      Check more info from Yum Downgrade guide.

      Please let me know if you have any problems?

  22. 3.11.7-100 fedora 18
    Everything works great but I’m having some trouble at iptables configure
    I had to create te file
    nano -w /etc/sysconfig/iptables
    Add following INPUT rule:
    -A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
    then

    # systemctl restart iptables
    Job for iptables.service failed. See 'systemctl status iptables.service' and 'journalctl -xn' for details.

    I get this output

    # systemctl status iptables
    iptables.service - IPv4 firewall with iptables
    Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled)
    Active: failed (Result: exit-code) since mié 2013-11-20 12:19:05 VET; 1min 3s ago
    Process: 10636 ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=1/FAILURE)

    nov 20 12:19:05 localhost.localdomain systemd[1]: Starting IPv4 firewall with iptables...
    nov 20 12:19:05 localhost.localdomain iptables.init[10636]: iptables: Aplicando reglas del cortafuegos:iptables-restore: line 1 failed
    nov 20 12:19:05 localhost.localdomain iptables.init[10636]: [8B blob data]
    nov 20 12:19:05 localhost.localdomain systemd[1]: iptables.service: main process exited, code=exited, status=1/FAILURE
    nov 20 12:19:05 localhost.localdomain systemd[1]: Failed to start IPv4 firewall with iptables.
    nov 20 12:19:05 localhost.localdomain systemd[1]: Unit iptables.service entered failed state.

    • Hi Robert,

      Try following instead of adding that row to /etc/sysconfig/iptables:

      firewall-cmd --permanent --zone=public --add-service=http
       
      firewall-cmd --permanent --zone=public --add --port=80/tcp
  23. Thanks, I will try this tonight and let you know if it worked :D

  24. It worked like a charm! :D Thank you VERY much!

    Now, i will follow your website :)

    Bye from
    Portugal

  25. Hi

    I need to install php-devel

    I run the command: sudo yum search –disablerepo=* –enablerepo=remi,remi.php55, remi-test php-devel
    that found “php-devel.x86_64 : Files needed for building PHP extension”. BUT, when i try to install, i get this error:

    sudo yum install php-devel.x86_64
    Loaded plugins: fastestmirror, refresh-packagekit, security
    Loading mirror speeds from cached hostfile
    * base: mirror.trueinter.net
    * epel: ftp.fau.de
    * extras: mirror.trueinter.net
    * updates: mirror.trueinter.net
    * webtatic: us-east.repo.webtatic.com
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package php-devel.x86_64 0:5.3.3-27.el6_5 will be installed
    --> Processing Dependency: php(x86-64) = 5.3.3-27.el6_5 for package: php-devel-5.3.3-27.el6_5.x86_64
    --> Processing Dependency: automake for package: php-devel-5.3.3-27.el6_5.x86_64
    --> Processing Dependency: autoconf for package: php-devel-5.3.3-27.el6_5.x86_64
    --> Running transaction check
    ---> Package autoconf.noarch 0:2.63-5.1.el6 will be installed
    ---> Package automake.noarch 0:1.11.1-4.el6 will be installed
    ---> Package php-devel.x86_64 0:5.3.3-27.el6_5 will be installed
    --> Processing Dependency: php(x86-64) = 5.3.3-27.el6_5 for package: php-devel-5.3.3-27.el6_5.x86_64
    --> Finished Dependency Resolution
    Error: Package: php-devel-5.3.3-27.el6_5.x86_64 (updates)
    Requires: php(x86-64) = 5.3.3-27.el6_5
    Installed: php-5.5.7-1.el6.remi.x86_64 (@remi-php55)
    php(x86-64) = 5.5.7-1.el6.remi
    Available: php-5.3.3-26.el6.x86_64 (base)
    php(x86-64) = 5.3.3-26.el6
    Available: php-5.3.3-27.el6_5.x86_64 (updates)
    php(x86-64) = 5.3.3-27.el6_5
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest

    What can i do?

    • Hi Richardd,

      Try simply:

      yum --enablerepo=remi,remi-php55 install php-devel
  26. Just for people who can have problem like me – with (re)start httpd service on Fedora 19:

    Job for httpd.service failed. See ‘systemctl status httpd.service’ and ‘journalctl -xn’ for details.
    (…)
    httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 of /etc/httpd/conf.modules.d/10-php…e

    In my case problem was openssl which had to be update by using:

    yum update openssl

    Regards

  27. I’m experiencing the same issues as Keys2IT above, CentOS 6.5. I added the remi repository to upgrade PHP from 5.3 to 5.5 and I had to uninstall phpmyadmin and php-mcrypt before it would let me. Then I ran

    yum --enablerepo=remi,remi-php55 update

    and it updated everything. Now I’m trying to reinstall phpmyadmin and php-mcrypt and getting the following…


    # yum --enablerepo=remi,remi-test --disablerepo=epel install php-mcrypt
    Loaded plugins: priorities, refresh-packagekit, security
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package php-mcrypt.x86_64 0:5.4.24-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.24-1.el6.remi for package: php-mcrypt-5.4.24-1.el6.remi.x86_64
    --> Finished Dependency Resolution
    Error: Package: php-mcrypt-5.4.24-1.el6.remi.x86_64 (remi)
    Requires: php-common(x86-64) = 5.4.24-1.el6.remi
    Installed: php-common-5.5.8-1.el6.remi.x86_64 (@remi-php55)
    php-common(x86-64) = 5.5.8-1.el6.remi
    Available: php-common-5.3.3-26.el6.x86_64 (base)
    php-common(x86-64) = 5.3.3-26.el6
    Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
    php-common(x86-64) = 5.3.3-27.el6_5
    Available: php-common-5.4.23-1.el6.remi.x86_64 (remi)
    php-common(x86-64) = 5.4.23-1.el6.remi
    Available: php-common-5.4.24-1.el6.remi.x86_64 (remi)
    php-common(x86-64) = 5.4.24-1.el6.remi
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest

    Here’s the output of “rpm -qa php\*”:


    php-process-5.5.8-1.el6.remi.x86_64
    php-ldap-5.5.8-1.el6.remi.x86_64
    php-common-5.5.8-1.el6.remi.x86_64
    php-devel-5.5.8-1.el6.remi.x86_64
    php-tidy-5.5.8-1.el6.remi.x86_64
    php-imap-5.5.8-1.el6.remi.x86_64
    php-pecl-jsonc-1.3.3-1.el6.remi.5.5.x86_64
    php-pecl-apc-3.1.15-0.3.svn329913.el6.remi.1.x86_64
    php-cli-5.5.8-1.el6.remi.x86_64
    php-gd-5.5.8-1.el6.remi.x86_64
    php-snmp-5.5.8-1.el6.remi.x86_64
    php-mbstring-5.5.8-1.el6.remi.x86_64
    php-php-gettext-1.0.11-3.el6.noarch
    php-xml-5.5.8-1.el6.remi.x86_64
    php-pdo-5.5.8-1.el6.remi.x86_64
    php-odbc-5.5.8-1.el6.remi.x86_64
    php-soap-5.5.8-1.el6.remi.x86_64
    php-xmlrpc-5.5.8-1.el6.remi.x86_64
    php-pecl-jsonc-devel-1.3.3-1.el6.remi.5.5.x86_64
    php-5.5.8-1.el6.remi.x86_64
    php-pear-1.9.4-23.el6.remi.noarch
    php-mysqlnd-5.5.8-1.el6.remi.x86_64
    php-pecl-zip-1.12.4-1.el6.remi.5.5.x86_64

  28. oops, I copied and pasted the wrong command/output… I was trying remi-test then.


    yum --enablerepo=remi,remi-php55 install php-mcrypt
    Loaded plugins: priorities, refresh-packagekit, security
    1146 packages excluded due to repository priority protections
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package php-mcrypt.x86_64 0:5.3.3-3.el6 will be installed
    --> Processing Dependency: php(zend-abi) = 20090626 for package: php-mcrypt-5.3.3-3.el6.x86_64
    --> Processing Dependency: php(api) = 20090626 for package: php-mcrypt-5.3.3-3.el6.x86_64
    --> Finished Dependency Resolution
    Error: Package: php-mcrypt-5.3.3-3.el6.x86_64 (epel)
    Requires: php(api) = 20090626
    Installed: php-common-5.5.8-1.el6.remi.x86_64 (@remi-php55)
    php(api) = 20121113-64
    Available: php-common-5.3.3-26.el6.x86_64 (base)
    php(api) = 20090626
    Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
    php(api) = 20090626
    Available: php-common-5.4.23-1.el6.remi.x86_64 (remi)
    php(api) = 20100412-x86-64
    Available: php-common-5.4.24-1.el6.remi.x86_64 (remi)
    php(api) = 20100412-x86-64
    Available: php-common-5.5.7-1.el6.remi.x86_64 (remi-php55)
    php(api) = 20121113-64
    Error: Package: php-mcrypt-5.3.3-3.el6.x86_64 (epel)
    Requires: php(zend-abi) = 20090626
    Installed: php-common-5.5.8-1.el6.remi.x86_64 (@remi-php55)
    php(zend-abi) = 20121212-64
    Available: php-common-5.3.3-26.el6.x86_64 (base)
    php(zend-abi) = 20090626
    Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
    php(zend-abi) = 20090626
    Available: php-common-5.4.23-1.el6.remi.x86_64 (remi)
    php(zend-abi) = 20100525-x86-64
    Available: php-common-5.4.24-1.el6.remi.x86_64 (remi)
    php(zend-abi) = 20100525-x86-64
    Available: php-common-5.5.7-1.el6.remi.x86_64 (remi-php55)
    php(zend-abi) = 20121212-64
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest

  29. Installed as described but startup-service was not in folder /etc/init.d/
    So something went wrong during installation on fedora 20


    root@22:47:50 /etc/init.d (12)
    $ ls -la
    total 112
    drwxr-xr-x. 2 root root 4096 Feb 14 17:08 .
    drwxr-xr-x. 10 root root 4096 Jan 14 14:08 ..
    -rwxrwxrwx. 1 root root 117 Feb 13 14:33 dovecot
    -rw-r--r--. 1 root root 13430 Jan 14 13:34 functions
    -rwxr-xr-x. 1 root root 6928 Dec 12 01:49 livesys
    -rwxr-xr-x. 1 root root 6928 Feb 14 17:08 #livesys#
    -rwxr-xr-x. 1 root root 1054 Dec 12 01:48 livesys-late
    -rwxr-xr-x. 1 root root 2989 Jan 14 13:34 netconsole
    -rwxr-xr-x. 1 root root 6754 Jan 14 13:34 network
    -rw-r--r--. 1 root root 1160 Dec 5 23:22 README
    -rwxr-xr-x. 1 root root 6796 Dec 18 20:16 vboxautostart-service
    -rwxr-xr-x. 1 root root 10140 Dec 18 20:16 vboxballoonctrl-service
    -rwxr-xr-x. 1 root root 12679 Dec 18 20:16 vboxdrv
    -rwxr-xr-x. 1 root root 9917 Dec 18 20:16 vboxweb-service

    root@22:48:02 /etc/init.d (12)
    $ yum --enablerepo=remi install httpd php php-common
    Loaded plugins: langpacks, refresh-packagekit
    Package httpd-2.4.6-6.fc20.x86_64 already installed and latest version
    Package php-5.5.9-1.fc20.remi.x86_64 already installed and latest version
    Package php-common-5.5.9-1.fc20.remi.x86_64 already installed and latest version
    Nothing to do

    I had one error during installation


    chofer@22:33:48 ~/git/hub/emacs/org (7)
    $ sudo rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
    Retrieving http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
    warning: /var/tmp/rpm-tmp.7y2LiK: Header V3 RSA/SHA256 Signature, key ID 172ff33d: NOKEY
    Preparing... ################################# [100%]
    Updating / installing...
    1:rpmfusion-free-release-19-1 ################################# [100%]
    chofer@22:33:55 ~/git/hub/emacs/org (7)
    $ sudo rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
    Retrieving http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
    warning: /var/tmp/rpm-tmp.ehnP85: Header V3 RSA/SHA256 Signature, key ID cd30c86b: NOKEY
    Preparing... ################################# [100%]
    Updating / installing...
    1:rpmfusion-nonfree-release-19-1 ################################# [100%]
    chofer@22:34:06 ~/git/hub/emacs/org (7)
    $ sudo -i
    root@22:34:37 ~ (3)
    $ rpm -Uvh http://rpms.famillecollet.com/remi-release-20.rpm
    Retrieving http://rpms.famillecollet.com/remi-release-20.rpm
    warning: /var/tmp/rpm-tmp.tqwwI9: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
    Preparing... ################################# [100%]
    Updating / installing...
    1:remi-release-20-1.fc20.remi ################################# [100%]
    root@22:35:37 ~ (3)
    $ yum --enablerepo=remi install httpd php php-common
    Loaded plugins: langpacks, refresh-packagekit
    google-chrome | 951 B 00:00
    remi | 2.9 kB 00:00
    rpmfusion-free | 3.3 kB 00:00
    rpmfusion-free-updates | 3.3 kB 00:00
    rpmfusion-nonfree | 3.3 kB 00:00
    rpmfusion-nonfree-updates | 3.3 kB 00:00
    russianfedora-free | 3.6 kB 00:00
    russianfedora-free-updates | 3.6 kB 00:00
    russianfedora-nonfree | 3.6 kB 00:00
    russianfedora-nonfree-updates | 3.6 kB 00:00
    updates/20/x86_64/metalink | 30 kB 00:00
    updates | 4.6 kB 00:00
    virtualbox | 951 B 00:00
    (1/2): remi/20/primary_db | 349 kB 00:00
    (2/2): updates/20/x86_64/primary_db | 7.8 MB 00:07
    (1/11): rpmfusion-free/20/x86_64/group_gz | 1.6 kB 00:00
    (2/11): google-chrome/primary | 1.9 kB 00:00
    (3/11): rpmfusion-free-updates/20/x86_64/group_gz | 1.6 kB 00:00
    (4/11): rpmfusion-nonfree/20/x86_64/group_gz | 1.0 kB 00:00
    (5/11): rpmfusion-nonfree-updates/20/x86_64/group_gz | 1.0 kB 00:00
    (6/11): rpmfusion-nonfree/20/x86_64/primary_db | 137 kB 00:00
    (7/11): rpmfusion-nonfree-updates/20/x86_64/primary_db | 51 kB 00:00
    (8/11): rpmfusion-free-updates/20/x86_64/primary_db | 150 kB 00:00
    (9/11): rpmfusion-free/20/x86_64/primary_db | 445 kB 00:01
    (10/11): updates/20/x86_64/updateinfo | 740 kB 00:01
    (11/11): updates/20/x86_64/pkgtags | 961 kB 00:01
    google-chrome 3/3
    Resolving Dependencies
    --> Running transaction check
    ---> Package httpd.x86_64 0:2.4.6-6.fc20 will be installed
    --> Processing Dependency: httpd-tools = 2.4.6-6.fc20 for package: httpd-2.4.6-6.fc20.x86_64
    error: rpmdbNextIterator: skipping h# 1546 region trailer: BAD, tag 1314205516 type 1768846712 offset -540159542 count 775107116

    error: rpmdbNextIterator: skipping h# 1546 region trailer: BAD, tag 1314205516 type 1768846712 offset -540159542 count 775107116
    --> Processing Dependency: fedora-logos-httpd for package: httpd-2.4.6-6.fc20.x86_64

    And for db-packages another one


    ---> Package postgresql-libs.x86_64 0:9.3.2-2.fc20 will be installed
    --> Finished Dependency Resolution
    error: rpmdbNextIterator: skipping h# 1546 region trailer: BAD, tag 1314205516 type 1768846712 offset -540159542 count 775107116

    Dependencies Resolved

    ================================================================================

    Has anybody an idea what I did wrong?

    • Hi Christian Hofer,

      Fedora 20 doesn’t use anymore init.d scripts, you can use the another command:

      service httpd start
       
      ## or you can also use ##
      systemctl start httpd.service

      And about yum errors, looks like your rpmdb is corrupted some reason, you could try rebuild it using following command(s):

      yum update rpm
       
      rpmdb --rebuilddb
  30. Can I use the php56?

    yum --enablerepo=remi,remi-php56 install httpd php php-common

    • Hi Eduardo,

      Yes you can, but PHP 5.6 is currently alpha version and only for testing, not for production use. First beta maybe appear later this month and stable release maybe June.

  31. Hi everybody !

    I have some issues on my actual setup.
    I can not install phpmyadmin as decribe.

    My setup :

    # cat /etc/redhat-release
    CentOS release 6.5 (Final)

    # php -v
    PHP 5.5.10 (cli) (built: Mar 11 2014 17:37:46)
    Copyright (c) 1997-2014 The PHP Group

    # mysql -V
    mysql Ver 14.14 Distrib 5.5.36, for Linux (x86_64) using readline 5.1

    If someone can help ?


    # yum --enablerepo=remi,remi-test install phpmyadmin
    Loaded plugins: fastestmirror, presto
    Loading mirror speeds from cached hostfile
    ^[[A * epel: be.mirror.eurid.eu
    * remi: fr2.rpmfind.net
    * remi-test: fr2.rpmfind.net
    * webtatic: nl.repo.webtatic.com
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package phpMyAdmin.noarch 0:4.1.12-1.el6.remi will be installed
    --> Processing Dependency: php-tidy for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
    --> Processing Dependency: php-tcpdf-dejavu-sans-fonts for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
    --> Processing Dependency: php-tcpdf for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
    --> Processing Dependency: php-recode for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
    --> Processing Dependency: php-gmp for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
    --> Processing Dependency: php-bcmath for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
    --> Running transaction check
    ---> Package php-bcmath.x86_64 0:5.4.26-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-bcmath-5.4.26-1.el6.remi.x86_64
    ---> Package php-recode.x86_64 0:5.4.26-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-recode-5.4.26-1.el6.remi.x86_64
    --> Processing Dependency: librecode.so.0()(64bit) for package: php-recode-5.4.26-1.el6.remi.x86_64
    ---> Package php-tcpdf.noarch 0:6.0.061-1.el6.remi will be installed
    ---> Package php-tcpdf-dejavu-sans-fonts.noarch 0:6.0.061-1.el6.remi will be installed
    --> Processing Dependency: dejavu-sans-fonts for package: php-tcpdf-dejavu-sans-fonts-6.0.061-1.el6.remi.noarch
    ---> Package php-tidy.x86_64 0:5.4.26-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-tidy-5.4.26-1.el6.remi.x86_64
    --> Processing Dependency: libtidy-0.99.so.0()(64bit) for package: php-tidy-5.4.26-1.el6.remi.x86_64
    ---> Package php55w-common.x86_64 0:5.5.9-1.w6 will be installed
    --> Running transaction check
    ---> Package dejavu-sans-fonts.noarch 0:2.30-2.el6 will be installed
    --> Processing Dependency: dejavu-fonts-common = 2.30-2.el6 for package: dejavu-sans-fonts-2.30-2.el6.noarch
    ---> Package libtidy.x86_64 0:0.99.0-19.20070615.1.el6 will be installed
    ---> Package php-bcmath.x86_64 0:5.4.26-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-bcmath-5.4.26-1.el6.remi.x86_64
    ---> Package php-recode.x86_64 0:5.4.26-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-recode-5.4.26-1.el6.remi.x86_64
    ---> Package php-tidy.x86_64 0:5.4.26-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-tidy-5.4.26-1.el6.remi.x86_64
    ---> Package recode.x86_64 0:3.6-28.1.el6 will be installed
    --> Running transaction check
    ---> Package dejavu-fonts-common.noarch 0:2.30-2.el6 will be installed
    --> Processing Dependency: fontpackages-filesystem for package: dejavu-fonts-common-2.30-2.el6.noarch
    ---> Package php-bcmath.x86_64 0:5.4.26-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-bcmath-5.4.26-1.el6.remi.x86_64
    ---> Package php-recode.x86_64 0:5.4.26-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-recode-5.4.26-1.el6.remi.x86_64
    ---> Package php-tidy.x86_64 0:5.4.26-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-tidy-5.4.26-1.el6.remi.x86_64
    --> Running transaction check
    ---> Package fontpackages-filesystem.noarch 0:1.41-1.1.el6 will be installed
    ---> Package php-bcmath.x86_64 0:5.4.26-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-bcmath-5.4.26-1.el6.remi.x86_64
    ---> Package php-recode.x86_64 0:5.4.26-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-recode-5.4.26-1.el6.remi.x86_64
    ---> Package php-tidy.x86_64 0:5.4.26-1.el6.remi will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-tidy-5.4.26-1.el6.remi.x86_64
    --> Finished Dependency Resolution
    Error: Package: php-bcmath-5.4.26-1.el6.remi.x86_64 (remi)
    Requires: php-common(x86-64) = 5.4.26-1.el6.remi
    Installed: php-common-5.5.10-1.el6.remi.1.x86_64 (@remi-php55)
    php-common(x86-64) = 5.5.10-1.el6.remi.1
    Available: php-common-5.3.3-26.el6.x86_64 (base)
    php-common(x86-64) = 5.3.3-26.el6
    Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
    php-common(x86-64) = 5.3.3-27.el6_5
    Available: php-common-5.4.25-2.el6.remi.x86_64 (remi)
    php-common(x86-64) = 5.4.25-2.el6.remi
    Available: php-common-5.4.26-1.el6.remi.x86_64 (remi)
    php-common(x86-64) = 5.4.26-1.el6.remi
    Available: php54w-common-5.4.25-1.w6.x86_64 (webtatic)
    php-common(x86-64) = 5.4.25-1.w6
    Installing: php55w-common-5.5.9-1.w6.x86_64 (webtatic)
    php-common(x86-64) = 5.5.9-1.w6
    Available: php54w-common-5.4.24-1.w6.x86_64 (webtatic)
    Not found
    Available: php55w-common-5.5.8-1.w6.x86_64 (webtatic)
    Not found
    Error: Package: php-tidy-5.4.26-1.el6.remi.x86_64 (remi)
    Requires: php-common(x86-64) = 5.4.26-1.el6.remi
    Installed: php-common-5.5.10-1.el6.remi.1.x86_64 (@remi-php55)
    php-common(x86-64) = 5.5.10-1.el6.remi.1
    Available: php-common-5.3.3-26.el6.x86_64 (base)
    php-common(x86-64) = 5.3.3-26.el6
    Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
    php-common(x86-64) = 5.3.3-27.el6_5
    Available: php-common-5.4.25-2.el6.remi.x86_64 (remi)
    php-common(x86-64) = 5.4.25-2.el6.remi
    Available: php-common-5.4.26-1.el6.remi.x86_64 (remi)
    php-common(x86-64) = 5.4.26-1.el6.remi
    Available: php54w-common-5.4.25-1.w6.x86_64 (webtatic)
    php-common(x86-64) = 5.4.25-1.w6
    Installing: php55w-common-5.5.9-1.w6.x86_64 (webtatic)
    php-common(x86-64) = 5.5.9-1.w6
    Available: php54w-common-5.4.24-1.w6.x86_64 (webtatic)
    Not found
    Available: php55w-common-5.5.8-1.w6.x86_64 (webtatic)
    Not found
    Error: Package: php-recode-5.4.26-1.el6.remi.x86_64 (remi)
    Requires: php-common(x86-64) = 5.4.26-1.el6.remi
    Installed: php-common-5.5.10-1.el6.remi.1.x86_64 (@remi-php55)
    php-common(x86-64) = 5.5.10-1.el6.remi.1
    Available: php-common-5.3.3-26.el6.x86_64 (base)
    php-common(x86-64) = 5.3.3-26.el6
    Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
    php-common(x86-64) = 5.3.3-27.el6_5
    Available: php-common-5.4.25-2.el6.remi.x86_64 (remi)
    php-common(x86-64) = 5.4.25-2.el6.remi
    Available: php-common-5.4.26-1.el6.remi.x86_64 (remi)
    php-common(x86-64) = 5.4.26-1.el6.remi
    Available: php54w-common-5.4.25-1.w6.x86_64 (webtatic)
    php-common(x86-64) = 5.4.25-1.w6
    Installing: php55w-common-5.5.9-1.w6.x86_64 (webtatic)
    php-common(x86-64) = 5.5.9-1.w6
    Available: php54w-common-5.4.24-1.w6.x86_64 (webtatic)
    Not found
    Available: php55w-common-5.5.8-1.w6.x86_64 (webtatic)
    Not found

    Merci !!

    • Hi Said,

      Try following:

      yum --enablerepo=remi,remi-php55,remi-test install phpmyadmin
  32. Hi,
    When I run the command ‘service iptable restart’ returns with an error:
    Failed to issue method call: Unit iptable.service failed to load: No such file or directory.

Add Comment Register



Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackbacks/Pingbacks

  1. Install Apache (httpd) and PHP 5.3.3 on Fedora 13, CentOS/RHEL 5.5/6 « apache - [...] Pełny artykuł na: Install Apache (httpd) and PHP 5.3.3 on Fedora 13, CentOS/RHEL 5.5/6 [...]
  2. Configuring PHP, Apache and Squirrelmail - [...] scripting language. Take a look at this. https://www.digitalocean.com/communi...ck-on-centos-6 http://www.if-not-true-then-false.co...-red-hat-rhel/ & [...]