-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
starter.ini: Make the PHP version configurable #156
Comments
Yeah we can grab the PHP API version (dated folder name of the PHP version currently in use) and derive the extension_path with this: echo /usr/lib/php/"$(php -i | grep 'PHP API' | sed -e 's/PHP API => //')" Even better, instead of building out the assumed extension path we can grab it directly: php -r 'echo ini_get("extension_dir");' |
xdebug extension in echo -e "\nzend_extension = $(php -r 'echo ini_get("extension_dir");')/xdebug.so\n[XDebug]\nxdebug.client_host = 127.0.0.1\nxdebug.client_port = 9009\nxdebug.log = /var/log/xdebug.log\nxdebug.mode = debug\nxdebug.start_with_request = trigger\n" I am looking into consolidating Also since the extension path is dynamically derived it now makes sense to generate |
This approach will also be used in the ioncube install in |
IonCube does not have PHP 8 support yet. Therefore we have to make sure that ioncube is currently only rolled out if php switch is on 7.4. |
I will make a note of that in the ioncobe comments in |
OK so I have an optional dynamic install of a supported (as per Now that the optional dynamic install of a PHP version works though,
We will continue to use https://github.com/gitpod-io/workspace-images/tree/master/mysql which is built upon https://github.com/gitpod-io/workspace-images/blob/master/full/Dockerfile so that we can get all the latest updates from Gitpod, hoever we we now have the option to pin any supported PHP version we like and we should be able to control the PPA used for that. With all this said, I will open another feature that allows to user to either install their optional PHP version using the OS version PPA (as the default) or to use Lastly I do have an issue logged with Gitpod that questions their usage of |
Depends on #172 |
swapping |
good idea |
Also working this in now. |
ioncube version mismatch ready to test in |
what exactly is the default php version for now? 7.4 or ? |
yeah |
Must still be checked for true not false.
|
OK I will fix this today |
This is one of those oddly flipped values since the function returns false if the first value is greater than the second but we want that reversed so after testing I think this is the line to use: [[ $(bash .gp/bash/utils.sh comp_ver_lt "$current_php_version" "8.0") == 1 ]] |
Are you talking about this these lines of code? Or these (probably these)? https://github.com/apolopena/gitpod-laravel-starter/blob/development/.gp/bash/install-xdebug.sh#L44 Can I keep this? I need it for php-fpm. |
This Line is corret
But this are the problem.
|
yeah ok thanks for clarifing. I thought so. I will change them to conf.d rather than directly in the php.ini |
and I think this will not work with a PHP8 workspace either.
Would have to be phpize8.0 |
Yeah
Yeah I will make that dynamic |
alright its close. xdebug and ioncube gets properly installed fro php 7.4 all dynamically. Dynamic phpize works too. Retaining the existing php version using an invalid value or I have to step away for the rest of the day. I will pick this back up this evening or tomorrow morning. |
@strausmann Long story short. Please make sure you create a new development branch in your fork to avoid any issue when you test. Feel free to test the items I mentioned above with screenshots if you like. Lastly I will work on the last remaining issues #170 and #176 now. Hopefully all this dynamic php installation and config, ppa, ioncube and xdebug is solid now. Looks that way to me so far. |
@apolopena |
Problem this feature will solve
Users are forced to use the version of PHP that the gitpods
workspace-full
image uses. Whenever the version of PHP changes in gitpodworkkspace-full
, this entire project breaks at the.Dockerfile
level (when the image is built) and will not run.Background
Currently the PHP version in
workspace-full
is version 8.0 which is only about 17% adopted vs the 45%-ish adoption rate of PHP 7.4Proposed Solution
Allow the PHP version to be set from
starter.ini
in the[PHP]
section.Acceptable values should be:
7.4
gitpodlatest
starter.ini
value7.4
will install PHP 7.4.* in addition to the latest PHP version and packages as per the gitpod image workspace-full with the following PHP packages:php7.4 php7.4-fpm php7.4-dev php7.4-bcmath php7.4-ctype php7.4-curl php-date php7.4-gd php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php-net-ftp php7.4-pgsql php7.4-sqlite3 php7.4-tokenizer php7.4-xml php7.4-zip
The default value in starter.ini should be this:
[PHP] version: 7.4
Also dynamically set the PHP API (extension_dir) xdebug paths and anything else that needs the PHP API path (such as the server function
start_server
). The extensions path for PHP on a debian system can be dynamically obtained with the following command:php -r 'echo ini_get("extension_dir");'
Constraints and Assumptions
The Installs for PHP happen at the
.gitpod..Dockerfile
(Docker) level so the PHP version instarter.ini
will be cached! This means that any change to the PHP version instarter.ini
will require the docker cache to be cleaned by incrementing theINVALIDATE_CACHE
value in.gitpod..Dockerfile
Depends on #172
Alternatives or Workarounds
None worth mentioning
Additional context
Since the PHP extension path (extension_dir) will now derived dynamically nothing should break when Gitpod updates the version of PHP.
The text was updated successfully, but these errors were encountered: