Announcement

Collapse
No announcement yet.

PHP Issue

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    PHP Issue

    I just set up a Kubuntu 15.04 box and installed the LAMP stack. However, php does not seem to be working. I tried to setup a joomla website, but it just displays the content of the index.php. I also tried creating a php.info file in the root folder. Even that only displays the content of the file in the browser.
    Please help....

    #2
    If you just type 'localhost' in a browser url bar, what happens? How did you set up the server?

    Comment


      #3
      Localhost successfully gives me the Apache page. Apache was installed with the following command
      sudo apt-get install apache2

      Comment


        #4
        How did you put the website on the server? Did you put a virtual host for the site file in /etc/apache2/sites-available?

        Comment


          #5
          I installed Webmin and then Virtualmin. A website was created in virtualmin. But I tried putting a file to check php (info.php) in the root of the default site (/etc/var/www/home). That gives me the same result. It is almost as if php scripts are not running

          Comment


            #6
            A couple of ideas, it depends how you set up Joomla...

            Maybe you're being served content from the default virtualhost (/var/www/), and your Joomla site is somewhere else (e.g. /var/www/joomla)?

            Or, if the Joomla site is installed in the root of /var/www/ then you'll have to remove the default apache index page, or it will be used in preference to the Joomla index page.
            samhobbs.co.uk

            Comment


              #7
              What Feathers said. Im not familiar with Webmin or Virtualmin, but there should be a virtual host file for your site in /etc/apache2/sites-available. In that file, you can set the document root and directory. This is a virtual host file for one of my sites:
              Code:
              <VirtualHost *:80>
                      ServerAdmin webmaster@localhost
                      ServerName sitename.dev
                      ServerAlias www.sitename.dev
                      DocumentRoot /home/whatthefunk/Web/Sitename/public
                      ErrorLog ${APACHE_LOG_DIR}/error.log
                      CustomLog ${APACHE_LOG_DIR}/access.log combined
              
                      <Directory /home/whatthefunk/Web/Sitename/public>
                              AllowOverride All
                      </Directory>
              
                      <Directory />
                              AllowOverride All
                      </Directory>
              </VirtualHost>
              
              # vim: syntax=apache ts=4 sw=4 sts=4 sr noet

              Comment


                #8
                I believe the document roots are defined correctly. Localhost pulls up the correct apache "It Works" page. The document root for this is /var/www/html. I created a file called phpinfo.php with the contents
                <?php
                phpinfo();
                ?>
                When I open a browser and put in http://localhost/phpinfo.php, It just display the content of the phpinfo.php file in the browser.

                Comment


                  #9
                  Maybe the apache php module isn't loaded. Try this:

                  Code:
                  sudo a2enmod php5
                  ...which should enable the PHP module.

                  Then reload apache:

                  Code:
                  sudo service apache2 reload
                  Any change?
                  samhobbs.co.uk

                  Comment


                    #10
                    I think PHP did not install properly. I re installed LAMP and all is well now. I would like to thank you guys for the help provided.

                    Comment

                    Working...
                    X