Change Apache2 Php Path
I am using https://github.com/wilmoore/php-version to switch between php versions on my local machine, installed within
~/php/versions. Currently setting up separate VMs with different versions of php installed is not an option.
When I switch php version through the command line using the linked tool, I see it listed as php 7. This also works when using
php -v. I have restarted terminal and the machine and it still says php 7.
I have updated
composer.json to require php 7.0.2 and greater. Yet when I use
phpinfo() in my laravel application, it always states the default
PHP Version 5.5.9-1ubuntu4.14.
Where is laravel pointing to the php distribution in my Ubuntu 14.04.3 machine and where can I change this path?
EDIT: I am using Apache. I can see in the
phpinfo() output that it is reading the
ini file from
/etc/php5/apache2/php.ini. I have looked in this file but cannot see where to point to the php distribution.
The Apache loads the php5_module library in
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
If you know the loactions of your alternative libraries you can change them in this file.
After editing you need to restart your apache.
sudo service apache2 restart or
sudo systemctl restart apache2.service
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?