SOLVED Custom php.ini for different vhosts

I currently am running Debian 6 with multiple vhost files. I'm curious as to how I would be able to let each vhost control their own php.ini.

When I was with dreamhost, I used this-http://wiki.dreamhost.com/PHP.ini

But I wanted to learn, and now here i am, but could someone please assist me in this situation?

Thanks,

-John

4 Replies

I think you can't do that. There is only one php.ini but you can change some values: http://php.net/manual/en/configuration.changes.php

There's this article from HowtoForge, but it's 3 years old and I have no idea whether or not it still works.

If that doesn't work, your only choice would be to switch to CGI/FastCGI, or use .htaccess to tweak per-site PHP configuration. Fortunately, most of the things that site owners might want to tweak can be tweaked via .htaccess, and the few things that can't be tweaked via .htaccess are off limits for a very good reason (security).

If you're feeling adventurous then PHP-FPM has this capability built in, each pool can have a separate ini file, or you can try this

http://php.net/manual/en/configuration. … r-user.php">http://php.net/manual/en/configuration.file.per-user.php

@hybinet

that link to the tutorial worked like a charm, thank you!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct