: How can you use Apache .htaccess to specify the location of the PHP binary on shared hosting? I'm using shared hosting, can create .htaccess and php.ini and have access to ssh. I have PHP 5.6
I'm using shared hosting, can create .htaccess and php.ini and have access to ssh.
I have PHP 5.6 installed to ~/public_html/php56 and can use this path with ssh, cron and exec() but not on the web.
Apache uses php 5.4 because it's set in .htaccess:
AddHandler application/x-httpd-php54s .php
Is it possible to specify full php path using maybe AddHandler, Action, CGI etc.?
More posts by @Moriarity557
1 Comments
Sorted by latest first Latest Oldest Best
Doing it through a .htaccess file while theoretically possible can cause issues and so many shared web hosts prevent that directive in .htaccess. However depending on the hosting panel they are using you may be able to specify the PHP version to use using the hosting panel itself. Both cPanel and Plesk have the ability to specify the PHP version to be used for the websites on the account.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.