+ Reply to Thread
Results 1 to 8 of 8

Thread: problems with php on my website

  1. #1
    ekramy is offline x10Hosting Member ekramy is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    14

    problems with php on my website

    hi
    am having a very weird problem on my website all php files when opened show the php file contents instead of running. any ideas?
    http://ekramy.exofire.net/faq
    please help me

  2. #2
    lucasjnjones is offline x10Hosting Member lucasjnjones is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    7

    Re: problems with php on my website

    This issue is usually caused by a misconfigured server; if you're host is x10Hosting, submit a ticket. Otherwise, contact them. First, however, check that:
    • You are using the .php extension for your index.php file
    • Your host supports PHP
    • If you have a .htaccess file, try renaming it and trying again, to make sure it isn't causing the problem.

  3. #3
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: problems with php on my website

    Have you been editing .htaccess in ~/public_html/ or ~/public_html/faq? If so, what have you done? Post the actual configuration, not just a description of what you were trying to accomplish.

    You can try re-enabling PHP processing with:
    Code:
    AddHandler application/x-httpd-php5 .php
    On an unrelated note, your script is wide-open to SQL injection. The best solution is to switch to the PDO driver and prepared statements (searching this forum or the web will provide more info).
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  4. #4
    ekramy is offline x10Hosting Member ekramy is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    14

    Re: problems with php on my website

    @lucasjnjones :am hosting with x10hosting and i have done anything to htaccess files
    @mission: i ddint do anything to htaccess files and i know about the injection attacks am just demoing the website now and can you please elaborate more on the reenabling of php processing where do i execute or use that code?
    thank you both for your time

  5. #5
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: problems with php on my website

    Remove the line


    AddType x-mapp-php5 .php
    from your .htaccess file. Whatever/whomever put it there should not have.
    And try to keep your questions in one thread.
    Last edited by descalzo; 12-28-2009 at 06:47 PM.
    Nothing is always absolutely so.

  6. #6
    xgreenberetx is offline x10Hosting Member xgreenberetx is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    57

    Re: problems with php on my website

    Make sure they have the php tags inside. I do not see the <?php ?> tag on the faq page. Make sure the pages have the .php extension also.

  7. #7
    Twinkie is offline Banned Twinkie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Ft. Lauderdale, Florida
    Posts
    1,389

    Re: problems with php on my website

    You should give us more information. We don't know your experience with PHP, so we don't know if you are aware that you must keep your files within <?php ?> tags or that it must have a .php extention, or even that it must be on the server to be executed. Try pasting the source code of your PHP file, and the .htaccess file, with files names in the post and then we can help.
    Last edited by Twinkie; 12-29-2009 at 12:15 AM.

  8. #8
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: problems with php on my website

    The linked page has an opening <?php tag, which the browser tries to parse as an HTML tag, and an extension of ".php". The page is missing a closing ?>, though that's optional.

    Anyway, Bryon already solved this problem. ekramy has been cross-posting.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. Places to learn php
    By JaWasabi in forum Scripts & 3rd Party Apps
    Replies: 9
    Last Post: 01-13-2009, 02:03 AM
  2. [OFF] [30 or 50Credits]HOT! Vote on my site / register to my website
    By TPI007 in forum The Marketplace
    Replies: 24
    Last Post: 12-21-2008, 09:57 PM
  3. currently have an application pending php
    By biomasti in forum Free Hosting
    Replies: 1
    Last Post: 09-03-2008, 01:58 PM
  4. Having PHP problems.
    By cityeyes in forum Free Hosting
    Replies: 4
    Last Post: 08-19-2008, 01:46 AM
  5. PHP upgrade and Fantastico problems
    By tupakapoor in forum Free Hosting
    Replies: 2
    Last Post: 01-29-2008, 01:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers