TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Here's a stupid one... (http://www.talkphp.com/general/2862-heres-stupid-one.html)

delayedinsanity 05-29-2008 05:31 PM

Here's a stupid one...
 
It's amateur question hour... I just tried to upload one of my projects to a new subdomain on my site. To my wonderful surprise, it turns out that my host has PHP installed as CGI instead of an Apache module (why? because they were all abused as children and wish to take it out on their customers, and I'm locked in to them for now...) so I can't use php_ini in my .htaccess file without causing an internal server error. Grrr. So I was going to use ini_set() to add paths for both the host (linux) and my local server (windows), however, we have a small problem.

PHP Code:

ini_set('include_path''.:/data/16/1/7/24/1496513/user/1609716/htdocs/tuatara/bin/lib/');
ini_set('include_path''.;C:\\Users\\m\\Documents\\web sites\\htdocs-tuatara\\bin\\lib\\'); 

The second causes a problem because it's reading the semi-colon as an end of line delimiter, even though it's in quotes. I can't use a colon with windows paths, of course. I've solved this problem by just reverting to my old method of

PHP Code:

include($_SERVER['DOCUMENT_ROOT'].'/bin/lib/files...'); 

but I'm curious as to how I would solve this problem in the future if I need to set multiple include paths via ini_set() on a windows box?
-m

delayedinsanity 05-29-2008 05:33 PM

That was interesting. I think vBulletin must've thought I was attempting an attack - it stripped all my quotes and backslashes from the second ini_set() until I double backslashed it.
-m

Wildhoney 05-30-2008 01:59 AM

That'll be because the backslash is the escape character. For it to appear as a string, as you want it, you will need to specify it as a double back slash, or a forward slash would suffice.


All times are GMT. The time now is 06:13 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0