Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Seeing PHP source when file opened on server?

Options
  • 04-10-2009 9:57pm
    #1
    Registered Users Posts: 221 ✭✭


    Hi lads,

    When I run my PHP script on my server, it just shows the source code - nothing happens.

    To my knowledge this is a sign that the server does not support PHP, but when i bought the webhosting, it said it supported it.

    Can anyone shed any light on this for me ?

    Thanks,
    Dave


Comments

  • Registered Users Posts: 21,239 ✭✭✭✭Eoin


    You might have to enable PHP in the hosting control panel.


  • Closed Accounts Posts: 12,382 ✭✭✭✭AARRRGH


    Are you using correct PHP tags, i.e. <?php & ?> ?

    Are you using the .php extension?


  • Registered Users Posts: 221 ✭✭da4i's


    Turns out it does have PHP installed on the server ....

    This is confusing....

    Anyone any ideas?
    I am using the correct PHP tags too .


  • Registered Users Posts: 21,239 ✭✭✭✭Eoin


    PHP might be installed on the server, but you might have to turn it on in your hosting control panel.


  • Registered Users Posts: 221 ✭✭da4i's


    Turns out it doesnt show errors.... hmmm ... ah well. Any idea's how ta fix that ? The PHP is running now, i had an error in my code.

    Thanks for all help received,
    Dave


  • Advertisement
  • Closed Accounts Posts: 12,382 ✭✭✭✭AARRRGH


    Do you have access to your php.ini file? It's usually somewhere like /usr/local/lib. In there there's the setting "display_errors = On". You probably have it set to "off".


  • Registered Users Posts: 1,127 ✭✭✭smcelhinney


    Is the mime type for php set up? In mime.types

    application/x-httpd-php php
    application/x-httpd-php-source phps

    Although I think it is there by default.


  • Registered Users Posts: 3,140 ✭✭✭ocallagh


    da4i's wrote: »
    Turns out it doesnt show errors.... hmmm ... ah well. Any idea's how ta fix that ? The PHP is running now, i had an error in my code.

    Thanks for all help received,
    Dave
    just stick [PHP]ini_set("display_errors", 1); [/PHP]at the top of your file.


Advertisement