Virtual web hosting and sharing of php.ini configurations

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mgelinas
Forum Newbie
Posts: 13
Joined: Tue Jun 10, 2003 6:33 am
Location: QC Canada

Virtual web hosting and sharing of php.ini configurations

Post by mgelinas »

A number of the PHP configuration settings in the php.ini file can be altered with PHP function ini_set(). However, key variables to operate a custom session handler require the following settings outside the reach of ini_set():

Code: Select all

session.auto_start
session.save_handler = user
session.save_path
session.name
session.gc_maxlifetime
session.gc_probability
In an autonomous development environment, it is easy to set the proper configuration.

What happens in a virtual hosting environment with numerous domains using PHP and MySQL? Do domains have their own php.ini file or do they need to share the same one with the resulting conflicts and/or frustrations? Can the server administrators resort to some trick to let each domain do its own thing?

Since the session.save_path, .name, .gc_maxlifetime and .gc_probability settings are passed as values to the custom session handler, could we feed the handler functions by values rather than by variables?

In the worst scenario, for the first two settings, one would need to find a web site hoster that imposes session.auto_start = Off and session.save_handler = user on all hosted domains. It doesn't sound smart at all.

If there is an easy solution, I will surely appreciate to know about it.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

It depends which webserver is being used, Apache offers the ability to have both global and local settings:
http://php.net/manual/en/configuration.changes.php

Mac
mgelinas
Forum Newbie
Posts: 13
Joined: Tue Jun 10, 2003 6:33 am
Location: QC Canada

Post by mgelinas »

Dear Twigletmac, I see you're good at providing references. Site administrators love to do this. Do you have the reference for the use of the htaccess file, and if whether it answers my question?

I checked your reference. Looks like you're giving me an English dictionary and you tell me the novel I am looking for is all there but scrambled. Doesn't help much indeed.
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

A sample of a ".htaccess" file to affect the error logging in PHP:

php_flag display_errors off
php_flag log_errors on
php_value error_log /cactus/logs/errors.php.log

You will have to check this page to determine if you can affect the session options via .htaccess, looking at the page, it seems you can.

Hope this helps.

Regards,
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Dear mgelinas,

I see you're good at being sarcastic.
mgelinas wrote:Dear Twigletmac, I see you're good at providing references.
Because I know how to search the manual.
mgelinas wrote:Site administrators love to do this.
Because questions are generally not as unique as the poster might think.
mgelinas wrote:Do you have the reference for the use of the htaccess file, and if whether it answers my question?
I didn't realise I was being vague when I said that Apache allows both global and local configuration of PHP. As for further information Google?

There is absolutely no good reason to be rude to people trying to help you. I tried to give you a starting point it was a short answer because you didn't bother to mention anything about which webserver you use or even which version of PHP.

I give references because there's no point me retyping information available elsewhere, if you don't understand that information ask directed questions about the parts that are confusing.
mgelinas wrote:I checked your reference. Looks like you're giving me an English dictionary and you tell me the novel I am looking for is all there but scrambled.

I bothered to search the PHP manual to find the section on configuration to pass you that link. I didn't just give you RTFM which would have suited your analogy much better.
mgelinas wrote:Doesn't help much indeed.
So you decide to go all sarky after I tried to help, that's nice of you.

Please consider your answer carefully before your next post.

Mac
Last edited by twigletmac on Wed Jun 18, 2003 8:30 am, edited 1 time in total.
User avatar
releasedj
Forum Contributor
Posts: 105
Joined: Tue Jun 17, 2003 6:35 am

Post by releasedj »

mgelinas:

Why don't you try using some of your time trying to find out what you're after? Maybe because you thought someone would already know! Why reinvent the wheel, right?

Why would twigletmac give you references to places that provide answers to your question, instead of writing it all out? Maybe because twigletmac knew someone already had it written down! Why reinvent the wheel, right?

Hang on... those responses sound almost the same. Coincidence.. I think not.

A little search on google for htaccess provides alot of info.
It's difficult for other people to help you when you don't want to be helped.

Kelvin
mgelinas
Forum Newbie
Posts: 13
Joined: Tue Jun 10, 2003 6:33 am
Location: QC Canada

Post by mgelinas »

I see that the answer is essentially: Why bother this forum? Search the Web with Google, read the references (a polite RTFM) and with plenty of time and efforts, you will find by yourself your answers to your questions.

I thought that this was a mutual help forum as part of a PHP developers' network. Sorry, I was mistaken.

Yes, I mind reading references. Yes, I mind searching the Web. Yes, I did find plenty of things on my own. Looks like I will keep doing it on my own.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Slow down!

The general format for giving advice here is first to point people towards the information resources they need - like the php manual etc - but you will usually get help with further queries once you've tried your best with that.

It's only fair to expect people to help themselves before getting involved in their problems - we've all got our own projects to debug.

You'll get a lot of help here if you learn how the system works.

How does it go again..

"Give a man a fish
And you feed him for a day;
Teach him how to fish
And he'll clean out the whole damn ocean then complain like crazy when you try to impose sensible quotas.

Or something.
User avatar
releasedj
Forum Contributor
Posts: 105
Joined: Tue Jun 17, 2003 6:35 am

Post by releasedj »

mgelinas, in a way I see where you're coming from.. but why should anyone help someone who responds to a post like you did.

As like most forums there are people helping here for nothing, and like most forums there are people who take advantage of people's good will.

If you can't be polite when asking a question, I suggest you don't bother.. nobody's gonna miss a post like this.
Post Reply