posted by kevin on September 24, 2009

I recently created a site that had to be deployed on a GoDaddy server and it took a little playing around with the configuration before I could achieve what I wanted to do.

My main goal was to parse my .html and .php files using PHP5 as well as assigning a value to auto_prepend_file to my prepend file so I didn't have to include it on every page explicitly.

It's simple once you know, but here is how you achieve the two. Hopefully this helps at least one person out.

Godaddy, parse files as PHP

In the root of your site create an .htaccess file. Mine simply contained:

 
AddType application/x-httpd-php5 .htm .html .php
AddHandler x-httpd-php5  .htm .html .php
 

As you guessed this tells apache to parse .htm, .html, and .php files using PHP5.

Normally I'd include my php settings as PHP_Flag or PHP_Value in my .htaccess file, but godaddy does not allow this. So you need to do this.

Godaddy PHP5 INI settings

Create a file named php5.ini <--- Notice it's php5.ini not just php.ini

 
auto_prepend_file = /home/content/my/path/to/home/html/includes/prepend.php
 

You can include your other PHP ini settings in there, however that's all I needed.

One comment to "GoDaddy PHP5 .htaccess and PHP INI settings"

#103
Max says:
January 18, 2010 at 08:26 pm
Hey thanks, I had problems installing vtiger because I was limited to php.ini but by adding the php5.ini it works great now. Many thanks.
Bookmark and Share

Leave a Comment

Your email address will not be published.

(You can enclose code in <php></php> blocks.)

You may use Markdown syntax.

Please enter the letters as they are shown in the image above.
Letters are not case-sensitive.