Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

In Apache2 I configured PHP as CGI in a virtual host:

SetEnv PHPRC "/usr/local/php5.3"
ScriptAlias /php5.3 "/usr/local/php5.3/bin"
Action application/php5.3 /php5.3/php-cgi
AddType application/php5.3 .php

Everything works fine. Now I have some issues with the standard version of the GD because it restricts me in settings several hinting and anti-aliasing stuff for fonts. Therefore I want to modify the GD source and create a new shared library. Since I don't want a modifed library in my system I want only PHP to use that library.

My question now: How can I change the Apache configuration in a way that PHP uses a certain new version of the library?

Something like this does not work:

ScriptAlias /php5.3 "LD_LIBRARY_PATH=/path/to/my/lib:$LD_LIBRARY_PATH /usr/local/php5.3/bin"
share|improve this question

1 Answer 1

Can you replace the php-cgi with a shell-script wrapper that sets the environment you need, then executes the real php-cgi binary?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.