PHP5 and Apache

Discussion in 'Server Operation' started by lefloresg80, Dec 28, 2010.

  1. lefloresg80

    lefloresg80 New Member

    So I've tried to use Falko's howto for installing php and mysql, with no luck. I try to open the info.php all I get is the actual code of the page. When I look at the apache2 httpd.conf file I don't see any php module loaded. I'm not sure what to do.

    Thanks!
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Which tutorial (URL) are you referring to?
     
  3. lefloresg80

    lefloresg80 New Member

  4. vikas027

    vikas027 New Member

    Hey,

    You can follow these simple steps RHEL / CENTOS 5.5 onwards for LAMP setup.

    Code:
    1) # yum groupinstall "Web Server" "MySQL Database" --nogpgcheck
    
    2) # yum install php* mysql* httpd* --nogpgcheck
       # chkconfig --level=235 httpd on
       # chkconfig --level=235 mysqld on
    
    3) # cp -p /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf_orig
       # vim /etc/httpd/conf/httpd.conf
       {
       ...
       ...
       ...
       # At the end 
       <VirtualHost *:80>
           ServerAdmin root@mail.example.com
           DocumentRoot /var/www/html
           DirectoryIndex index.php index.html
           ServerName mail.example.com
           ErrorLog logs/mail.example.com-error_log
           CustomLog logs/mail.example.com-access_log common
       </VirtualHost>
      }
      
    4) Check Apache syntax
      
      # httpd -t
      Syntax OK
    
    5) Create PHP test file
      
      # vim /var/www/html/index.php
        {
        <?php
        
            phpinfo();
        
        ?>
        }
        
    6) # service httpd restart
    
    7) Check if PHP page is opening well.
    
       # elinks http://192.168.1.100
       # elinks http://192.168.1.100:80
       # elinks http://mail.example.com
       # elinks http://mail.example.com:80
     
  5. falko

    falko Super Moderator Howtoforge Staff

    Did you run this step?
    Code:
    yum install php
    Also, what's the output of
    Code:
    getenforce
    ?
     
  6. lefloresg80

    lefloresg80 New Member

    The output is Disabled
     
  7. lefloresg80

    lefloresg80 New Member

    Vikas, it didn't work. Would the results be affected if I'm using port 80?

    By the way, is FTP safe?
     
  8. lefloresg80

    lefloresg80 New Member

    By the way, I should explain. I'm creating a file server with webdav capabilities and ftp functionality. Currently I'm using Fedora 13 but I'm considering going into Ubuntu desktop/server or Debian directly. For the time being I'm also using the computer as my work desktop. Any comments on that? Don't need anything long just your personal preference! Thanks!
     
  9. vikas027

    vikas027 New Member

    Those were exact steps. Tell me where you got stuck along with error logs.
     
  10. lefloresg80

    lefloresg80 New Member

    Thanks.. I just made a clean install of Ubuntu Server and did the howto and it worked great. Now I'm just trying to get FTP to work well. I'm having issues with the permission to download from the FTP client
     

Share This Page