Per directory php ini settings

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
floydian
-


Joined: 26 Apr 2009
Posts: 6

PostPosted: Sun Apr 26, 2009 12:59 pm    Post subject: Per directory php ini settings Reply with quote

Hello, I need to turn on magic quotes in one directory. (magic_quotes_gpc which can't be set at run time)

I found out the old .htaccess trick doesn't work lol. Is there another way to do this? (Obviously PHP 5.3.0 has the PATH= setting in the php.ini, but I'm working with PHP 5.2.8, although I'll happily upgrade to 5.3 when it's in GA.)
Back to top View user's profile Send private message
floydian
-


Joined: 26 Apr 2009
Posts: 6

PostPosted: Sat May 02, 2009 3:37 am    Post subject: Reply with quote

Anyone?
Back to top View user's profile Send private message
anybody
-


Joined: 17 Mar 2008
Posts: 90

PostPosted: Sat May 02, 2009 7:47 am    Post subject: Reply with quote

http://us.php.net/magic_quotes
http://us.php.net/magic_quotes wrote:
Warning

This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.


http://us.php.net/manual/en/security.magicquotes.why.php
http://us.php.net/manual/en/security.magicquotes.why.php wrote:
  • There is no reason to use magic quotes because they are no longer a supported part of PHP. However, they did exist and did help a few beginners blissfully and unknowingly write better (more secure) code. But, when dealing with code that relies upon this behavior it's better to update the code instead of turning magic quotes on. So why did this feature exist? Simple, to help prevent SQL Injection. Today developers are better aware of security and end up using database specific escaping mechanisms and/or prepared statements instead of relying upon features like magical quotes.
Back to top View user's profile Send private message
floydian
-


Joined: 26 Apr 2009
Posts: 6

PostPosted: Sat May 02, 2009 8:59 pm    Post subject: Reply with quote

Thanks for the "copy and paste", but that doesn't answer the question.

Anybody else?
Back to top View user's profile Send private message
DonQuichote
-


Joined: 24 Dec 2006
Posts: 68
Location: The Netherlands

PostPosted: Sat May 02, 2009 9:49 pm    Post subject: Not an answer? Reply with quote

It did answer the question. Fix the code, don't cripple the server. If you rely on magic quotes, your site can be open to nice SQL injection attacks. Especially when using other encodings than iso-8859-1.
Back to top View user's profile Send private message
floydian
-


Joined: 26 Apr 2009
Posts: 6

PostPosted: Sun May 03, 2009 2:52 pm    Post subject: Reply with quote

FFS, it did not answer the question.

I shouldn't have to prove that I have a valid reason for using per directory PHP INI settings.

Either Abyss can do it, or it can't!!

Now, please don't waste my time telling me shit I already CENSORED know.

Can anyone tell me if Abyss allows per directory PHP INI settings? And if so, how?
Back to top View user's profile Send private message
floydian
-


Joined: 26 Apr 2009
Posts: 6

PostPosted: Sun May 03, 2009 3:05 pm    Post subject: Reply with quote

To show guys how wrong you are, I do work for a few folks that run older software that requires magic quotes.

It's not my job to fix that software. I am running a test server where I test my code edits before going live with them. However, I currently have to resort to stopping the webserver, changing my php.ini, and restarting.

This is in stark contrast to Apache which allows per directory php.ini settings.


Now, if Abyss can't do this, then that's fine. Please just tell me for God's sake.

Now, none of that was necessary to have been said. It didn't make my question any more clear.

So, if anyone knows the answer, please tell me.


By the way, perhaps I might want to have max script execution time increased on one directory. Or on another directory, I might want to enable mysqli instead of mysql or vice versa.

Anyways, thanks in advance to whomever actually answers my question.
Back to top View user's profile Send private message
anybody
-


Joined: 17 Mar 2008
Posts: 90

PostPosted: Mon May 04, 2009 7:52 am    Post subject: Reply with quote

floydian wrote:
FFS, it did not answer the question.

I shouldn't have to prove that I have a valid reason for using per directory PHP INI settings.

Either Abyss can do it, or it can't!!

Now, please don't waste my time telling me shit I already CENSORED know.

Can anyone tell me if Abyss allows per directory PHP INI settings? And if so, how?
lol, all the hostility. Don't get mad. It is only life.

The PHP INI settings your thinking about would be set in the htaccess file which Abyss doesn't use. There is a really good reason why PHP.net is ditching these functions and I suggest you heed their warnings. I also suggest you look up another way of doing this. I'm sure there are many many examples of how to do this on the internet. After all the internet is the second best guide in the world.

Look in your php.ini file to change the settings you need.

floydian wrote:
To show guys how wrong you are, I do work for a few folks that run older software that requires magic quotes.
Thank you for correcting me. If you were standing here in front of me I would shake your hand.

God Bless
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon May 04, 2009 10:54 am    Post subject: Re: Per directory php ini settings Reply with quote

floydian,

You can have two versions of php.ini coexist on the same site using this little workaround:
* Declare a first PHP interpreter and associate it with .php file extension. It will use the default php.ini that is installed with PHP.
* Create a second php.ini with all your specific settings and put it a subdirectory (for example conf2 inside PHP installation path).
* Declare a second PHP interpreter as follows:
- Interprter: the same php-cgi.exe as the first one (no need to install a second copy)
- Arguments:
Code:
-c c:/PHP5/conf2

- Associated extensions: .phpx
Note that it is important to choose another file name extension for files that will be processed with the second interpreter and PHP scripts' file name extensions must be changed accordingly.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
floydian
-


Joined: 26 Apr 2009
Posts: 6

PostPosted: Mon May 04, 2009 3:01 pm    Post subject: Reply with quote

Thanks aprelium for answering my question.

That would be a workable solution. It would require changing 100's of links and file names though.

If PHP 5.3 wasn't going to have the PATH deal in the ini file, I'd suggest adding support for per directory ini settings, but since they are, and since it's release should be very soon, I can make due with the workaround until then.

Thanks again aprelium ;)
Back to top View user's profile Send private message
rrinc
-


Joined: 24 Feb 2006
Posts: 725
Location: Arkansas, USA

PostPosted: Tue May 05, 2009 4:49 am    Post subject: Reply with quote

Not quite the same, but I've had different settings for hosts with the same PHP install. The addition of parameters when declaring the interpreter can be very powerful. I used it to have some of my hosts run in safe mode.
_________________
-Blake | New Server :D
SaveTheInternet
Soy hispanohablante. Puedes contactarme por mensajes privados.
Back to top View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group