Changing default PHP path?

kenhkan

Baseband Member
Messages
34
Hi everyone,

I'm wondering whether there's a way to change the default PHP path (the path displayed from "which php") being a user (on my host with SSH access) rather than a root. Currently I use .htaccess to add handlers for domains that use my own compiled PHP rather than the one provided by the host. But the problem is that there has to be a .htaccess with that configuration present. Is there a once-and-for-all approach to fix this? Thanks a lot!
 
not really, htacess is the quickest cleanest way to do it...

the Ht access file is an extension to the httpd file, you could edit this main file, (assuming that you had permission).
but it's much simpler, faster and cleaner to use a .htacess file.

what I would say is that if you use a lot of domains, or are constantly buying new domains, it might be better to build your own script to have the domains made and the .htaccess file added automatically.

there is a diabolical method that I stumbled upon that uses the httpd.conf file to use a different directory for an virtual host subdomain

include "/hosts/domains/*.conf" to add a series of conf files, (though this requires a restart each time a new confi file is used, and in that respect is no netter than your existing method.

another idea is to use
<virtualhost *>
servername *.com
serveralias *.com
documentroot /var/www/htdocs
...
then put allt he other stuff that you want here.
...
</virtualhost>

in that directory you now need a php script to forward to your proper files for that address...

trouble is,

without root access I doubt you'll be able to change the httpd.conf file.
it's so unlikely it's laughable that you'll get any admin to implement what I wrote above, it's so flakey that it's ridiculous, and if the admin did imlement it, in all seriousness I'd probably switch hosts!


with the level of accesss that you have, and assuming that your PHP script works perfectly...
I'd keep doing exactly what you are doing.

if adding htaccess files is getting to be a drag, then write a dashboard program to do it for you.
 
just as i thought... but thanks for the post. i learned something new no matter what. it sparked me because after i installed a custom PHP PEAR on my host, the system can recognize my local PEAR instead of the system one (usr/bin/pear.....) when i typed "which pear" in the console. i guess it wouldn't work for php then. thanks again!
 
Back
Top Bottom