I’m trying to run selenium tests with Apache2 and PHP 5.6. I seem to be running into some issues where the yaml file doesn’t seem to produce the documented behavior.
By default, the LoadModule path in /etc/apache2/mods-enabled/php5.load is incorrect. I tried to update it to /home/ubuntu/.phpenv/versions/$(phpenv global)/libexec/apache2/libphp5.so as per the docs but this fails too as there is no ~/.phpenv.
I changed the path to be /opt/circleci/.phpenv but the libexec directory is empty.
I searched the entire disk: sudo find / -name '*php*.so'
and found this file: /usr/lib/apache2/modules/libphp5.so
which is a symlink: /usr/lib/apache2/modules/libphp5.so -> /home/ubuntu/.phpenv/versions/5.6.17/libexec/apache2/libphp5.so
but as we’ve already discovered, ~/.phpenv doesn’t exist.
What is the correct way to get Apache2 and PHP 5.6 running as a module for browser testing?
This isn’t a great solution, since it doesn’t allow you to actually select your PHP version, but just leave the machine/php section off of your circle.yml file. The container will default to PHP 5.6.17, and it seems to be correctly configured out-of-the-box. This is the only solution I’ve found that allows me run PHP, as even recompiling PHP in every build didn’t work for me.
@MPLew-is Thanks for your tip.This does seem to work correctly. Strange that it would break even when specifying the same version. I do as you suggested but I decided to build a docker image and cache it for subsequent builds instead.
With the circle.yml above, $PHPENV_ROOT/versions/5.6.17/usr/lib/apache2/modules/libphp5.so should be available which you can copy to your apache directory.
In Ubuntu 12.04 build image we were using our forked php-build which generates the php module under libexec/apache2 directory.
I’m now rebuilding all PHP packages to make sure to include the apache module so that you don’t have to download everytime. Once they are preinstalled, I’ll update our doc to specify the location of the php module.
Please let me know if the circle.yml doesn’t work for you.