rewrite httpd.conf to rewrite php PATH in cron/.bash_profile

Version 1.62.0


If the CustomBuild options.conf php1_version is changed, DA itself doesn't know about the change being triggered. The result is the cron PATH and ~/.bash_profile files may have a PATH=/usr/local/php72/bin path set, when (for example) php1_ver=7.4 was set. The ./build rewrite_confs does issue a full User httpd.conf rewrite, so for any task.queue trigger of an apache rewrite (action=rewrite&value=httpd), this will trigger the rewrite of the cron and .bash_profile, resetting the correct php version, when needed. Note, the ./build php call does issue a full rewrite, so this would also trigger these file. The PATH is only set to a specific /usr/local/phpXX/bin path when a given domain is not using the default php vesrion (php1_ver). If the domain uses php2_ver (for example), that's when the PATH specifies something different for the cli calls to "php". The default php version would use /usr/local/bin/php, which will be a symbolic link to the active php1_ver, eg: /usr/local/bin/php -> /usr/local/php70/bin/php70 hence no PATH is needed to access it (aside from /usr/local/bin) This link may also exist, allowing just /bin to work to: /bin/php -> /usr/local/bin/php

Interested to try DirectAdmin? Get a 30-day Free Trial!