View Full Version : help needed with php.ini file
subbu
02-15-2006, 06:53 PM
Hi,
I need some help with php.ini file.
I have my files extensions as .html instead of .php so I need some help what to do in php.ini file to treat the html files as php files. Previously I worked with .htaccess file so I know how to do that in htaccess file but I dont know how to do that in php.ini file.
One more thing is include _path. I want to have default paths to some directories. But I dont know how to include them in include_path. I did it like
include_path = "home/public_html/library/:home/public_html/include/", where library and include are the directories to which I want to have default paths but its not working. Can anybody help me?
Thanks
subbu
Dustin
02-15-2006, 07:24 PM
You can define those in your apache handlers, its a link in cPanel, should be set to application/x-httpd-php
subbu
02-15-2006, 11:42 PM
Thank you very much for telling me about apache handlers. I was able make the server treat html pages as php pages.
But how can I include the default directories.
scotymax
03-10-2007, 07:57 PM
i'd also like to know what is the proper formatting for the include_path in the php.ini file, so that i don't have type all my includes like this:
include($DOCUMENT_ROOT . '/include/file.inc');
but rather
include('file.inc');
i understand that the semicolon divides the directories that are searched, so i'd probably just amend this:
.:/usr/lib/php:/usr/local/lib/php
with something like one of these (which i've tried, with no success)
/public_html/include
/usr/lib/public_html/include
/usr/local/lib/public_html/include
i gather this requires an understanding of the folder structure above what we are actually permissioned to see.
felgall
03-10-2007, 08:13 PM
In PHP it would be:
ini_set("include_path",".:/usr/lib/php:/usr/local/lib/php");
In the php.ini file it is:
include_path = ".:/usr/lib/php:/usr/local/lib/php";
of course that line is already in the default php.ini file so you only need to change it if you want to add more libraries to search.
scotymax
03-10-2007, 08:35 PM
sorry, yes... i was refering to include_path = "..." , though the ini_set info is handy. thanks.
i managed to answer my own question though by running print_r ($GLOBALS) to figure out the actual value of DOCUMENT_ROOT (why i didn't think of that before, i have no clue)... which was simply "/home/myusername/public_html/"
now it's just a matter of duplicating my php.ini file to every directory that i'm using php in. it would be nice if the php.ini file impacted every directory below it, which i notice it does not. thankfully i won't have many directories to worry about.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.