This website is deprecated, and remains online only for historic access to old issues and docs for historic versions of Virtualmin. It has been unmaintained for several years, and should not be relied on for up-to-date information. Please visit www.virtualmin.com instead.
On Webmin 1.610, Virtualmin 3.98.gpl, Apache/2.2.15 (CentOS 6.3) mod_fcgid/2.3.7, I need to set a different auto_prepend_file specific to a subdirectory of a virtual host.
As per the OP, I need to set a different auto_prepend_file specific to a subdirectory of a virtual host. The prepended file sets newrelic_set_appname. When using mod_fcgi, there is no other way around it, besides modifying off the shelf app code (magento and WP in my case).
*** Keep in mind, Virtualmin is not designed to break the way a feature of PHP is built, so the above solution may be the only way to accomplish the task if you're not using either "CGI" or "FCGI" setup as noted in the former solution. ***
I am using neither CGI or FCGI (FastCGI). I am using mod_fcgid. Also, grabbing the output of an entire script and placing it in a buffer is a resource intensive operation. No can do, but thanks.
Like I said, the above solution is a work around, and personal I don't feel it's nearly as ideal as using either "CGI" or "FCGI" which supports the per directory functionality you are seeking.
Since neither of the solutions are to your liking, I'd recommend writing to the PHP team directly and ask for this feature to be made available, as this is something that Virtualmin will not be able to accomplish for you given it's not a Virtualmin issue, but rather a native PHP issue itself.
The other is to build in the needed per dir directives into the logic of the single prepended php file, which is what I opted to do since it is the option that requires the least modification to Virtualmin.
Hi,
Could you please expand on what you're trying to do a bit more, thanks :-)
Best Regards,
Peter Knowles
TPN Solutions
E: pknowles@tpnsolutions.com
P: 604-782-9342
W: http://www.tpnsolutions.com
Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
You can't have per dir php.ini or user.ini in mod_fcgid, hence the need to use a prepended file.
Thanks
Hi,
Why would you need a "per directory" configuration file? Could you elaborate on what your needs are, so we can help put together a potential solution.
Best Regards,
Peter Knowles
TPN Solutions
E: pknowles@tpnsolutions.com
P: 604-782-9342
W: http://www.tpnsolutions.com
Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
As per the OP, I need to set a different auto_prepend_file specific to a subdirectory of a virtual host. The prepended file sets newrelic_set_appname. When using mod_fcgi, there is no other way around it, besides modifying off the shelf app code (magento and WP in my case).
Hi,
Recommended reading, which may solve your problem.
http://php.net/manual/en/configuration.file.per-user.php
Best Regards,
Peter Knowles
TPN Solutions
E: pknowles@tpnsolutions.com
P: 604-782-9342
W: http://www.tpnsolutions.com
Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
user.ini is only read when using CGI or FastCGI, which, again, is not my case.
Hi,
You could try the solution found in answer #3 at:
http://stackoverflow.com/questions/4248140/how-to-set-phps-auto-prepend-...
*** Keep in mind, Virtualmin is not designed to break the way a feature of PHP is built, so the above solution may be the only way to accomplish the task if you're not using either "CGI" or "FCGI" setup as noted in the former solution. ***
Best Regards,
Peter Knowles
TPN Solutions
E: pknowles@tpnsolutions.com
P: 604-782-9342
W: http://www.tpnsolutions.com
Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
I am using neither CGI or FCGI (FastCGI). I am using mod_fcgid. Also, grabbing the output of an entire script and placing it in a buffer is a resource intensive operation. No can do, but thanks.
Hi,
Like I said, the above solution is a work around, and personal I don't feel it's nearly as ideal as using either "CGI" or "FCGI" which supports the per directory functionality you are seeking.
Since neither of the solutions are to your liking, I'd recommend writing to the PHP team directly and ask for this feature to be made available, as this is something that Virtualmin will not be able to accomplish for you given it's not a Virtualmin issue, but rather a native PHP issue itself.
You can get support for PHP matters by visiting:
http://php.net/support.php
Best Regards,
Peter Knowles
TPN Solutions
E: pknowles@tpnsolutions.com
P: 604-782-9342
W: http://www.tpnsolutions.com
Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
I don't even think this is an issue with PHP, but an issue with how PHP is handled by Apache.
Regardless, I was looking for options. One of them is to use the htaccess scanner module: http://pecl.php.net/package/htscanner
The other is to build in the needed per dir directives into the logic of the single prepended php file, which is what I opted to do since it is the option that requires the least modification to Virtualmin.
Thanks Peter!