PHP not enabled by default on GoDaddy shared linux web hosting

17,233

Searching suggests that GoDaddy shared hosting does indeed have php enabled by default.

PHP is a popular and simple server scripting language that enables Web developers to embed dynamic content into Web pages. PHP 5 is enabled for all Linux hosting accounts. PHP 5 is enabled for Windows hosting accounts running IIS 7, only.

Seeing the text of your .php file sent back to you like this generally suggests that the httpd server is misconfigured. As this is a server side issue and you are on shared hosting then the only people who can fix this are GoDady.

You should press your issue with them - provide them the link to your php page that is not loading correctly to demonstrate the issue.

Share:
17,233

Related videos on Youtube

Gotcha
Author by

Gotcha

I am a software engineer in Pittsburgh, PA with a focus on architecture, design and development of solutions

Updated on September 18, 2022

Comments

  • Gotcha
    Gotcha over 1 year

    I recently made the mistake of starting a web hosting account with GoDaddy. Let me start by saying that any comments or answers that I should walk away from the money I spent with GoDaddy and go with someone else will be flagged. I have heard this countless times and do not wish to hear it again.

    Perhaps I am naive but I thought that PHP was enabled by default on shared web hosting. Certainly PHP should be enabled, my account started with two webform mailer scripts, webformmailer.php and gdform.php. There also exists a php.ini file that cannot be modified or deleted. It seems to prevent certain things like registering globals and other security concerns on a shared hosting environment.

    PHP is not enabled though. A simple test script spits back text, telling me the PHP handler doesn't exist or it is just not installed.

    <?php phpinfo(); ?>
    

    The above just returns text.

    There was no .htaccess file so I decided to add one myself. It made no difference.

    AddHandler application/x-httpd-php .php

    Options +ExecCGI +FollowSymLinks

    The php.ini file that they provided in my account is as follows:

    register_globals = off
    allow_url_fopen = off
    
    expose_php = On
    max_input_time = 60
    variables_order = "EGPCS"
    extension_dir = ./
    upload_tmp_dir = /tmp
    precision = 12
    SMTP = relay-hosting.secureserver.net
    url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
    
    
    ; Only uncomment zend optimizer lines if your application requires Zend Optimizer support
    
    ;[Zend]
    ;zend_optimizer.optimization_level=15
    ;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
    ;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
    ;zend_extension=/usr/local/Zend/lib/Optimizer-3.3.3/ZendExtensionManager.so
    ;zend_extension_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3/ZendExtensionManager_TS.so
    
    
    ; -- Be very careful to not to disable a function which might be needed!
    ; -- Uncomment the following lines to increase the security of your PHP site.
    
    ;disable_functions = "highlight_file,ini_alter,ini_restore,openlog,passthru,
    ;             phpinfo, exec, system, dl, fsockopen, set_time_limit,
    ;                     popen, proc_open, proc_nice,shell_exec,show_source,symlink"
    

    After contacting customer support they insist that there is nothing wrong with my account. I must be doing something very stupid here because I can't find any instance on the web where somebody experienced a similar problem with GoDaddy.

    • ionFish
      ionFish about 11 years
      Try running <?php echo date();?> and see if it returns anything. I have a suspicion that GoDaddy disables phpinfo() for security purposes. If it still fails, comment here please.
    • Gotcha
      Gotcha about 11 years
      @ionFish Nope... still just text.
    • Su'
      Su' about 11 years
      Voting to close. GoDaddy does offer PHP standard on their hosting plans. If it's not working, this is a support issue, not something outside people are going to solve for you.
    • Gotcha
      Gotcha about 11 years
      @Su' I suspected as much, I just wanted to verify that it wasn't somehow my fault. You are wrong on this.
    • Simon Hayter
      Simon Hayter about 11 years
      I got a Godaddy account and it has no problems using phpinfo. You can enable ssh within your control panel and find out whats going on.
  • Gotcha
    Gotcha about 11 years
    Thank you, I wanted a sanity check. I was curious though... they have a one click install for Wordpress but I don't need it so I never attempted to install it. Is it possible that PHP will only be enabled by installing Wordpress, seeing as how most GoDaddy sites use either their website builder tool or Wordpress?
  • Admin
    Admin about 11 years
    @maple_shaft: I really don't know GD except by reputation. It's not going to hurt to try the one click install - the worst that happens is that it provides you more ammunition... I would remove any tweaks I had made to php.ini, .htaccess etc and confirm that it still doesn't work. Backup my files. Install WP and see what happens. If it still doesn't work you have more ammo if it does - winner.
  • Admin
    Admin about 11 years
    If it works then you'll need to disable it (delete) and undo some bits and pieces it places in the .htaccess etc.