Results 1 to 3 of 3

Thread: PHP scrips dont run.

  1. #1
    Join Date
    Sep 2013
    Beans
    50

    PHP scrips dont run.

    Hi,

    I have noticed a few times when building websites and visiting some web pages that when I use a contact form with a PHP script behind it ubuntu seems to try and open the file with a dialogue box appearing stating that there is not software installed to run php rather that the script being run like it does on my windows machine. is there something I need to install to enable this to work?

    Thanks in advance

    Adam

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    11,371
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: PHP scrips dont run.

    On Ubuntu, the code to enable PHP is contained in the package libapache2-mod-php5. It adds two files to /etc/apache2/mods-available/, php5.conf and php5.load, and creates symbolic links to those files in /etc/apache2/mods-enabled/. Look at the code in php5.conf. It begins with

    Code:
    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    which tells Apache to invoke the PHP module, loaded in php5.load, for files ending in appropriate extensions like .php, .php5, .php?, or the very old .phtml. (The matching template is a "regular expression.")

    I don't know whether you are in charge of the server on which your scripts are run. But if you use an Ubuntu server, make sure you have these files. If not, install the libapache2-mod-php5 package, or use tasksel to install Apache2, PHP5, and MySQL5.
    Last edited by SeijiSensei; January 10th, 2014 at 04:45 PM.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Sep 2013
    Beans
    50

    Re: PHP scrips dont run.

    Hi SeijiSensei,

    I used the command sudo apt-get install libapache2-mod-php5 in the terminal and I am now able to access websites that use PHP.

    Thankyou so much for your help!

    Regards.

    Adam

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •