Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 12-10-2006, 12:27 PM   #1
Baseband Member
 
kenhkan's Avatar
 
Join Date: Aug 2004
Posts: 34
Default Changing default PHP path?

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!
__________________

__________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." -Rich Cook
kenhkan is offline   Reply With Quote
Old 12-11-2006, 07:11 AM   #2
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,004
Default Re: Changing default PHP path?

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.
__________________

__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 12-11-2006, 09:10 AM   #3
Baseband Member
 
kenhkan's Avatar
 
Join Date: Aug 2004
Posts: 34
Default Re: Changing default PHP path?

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!
__________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." -Rich Cook
kenhkan is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 11:41 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0