Config Questions Local 6.4.3

@austinwendt

When you change PHP version from 7.4.1 to 8.0.22 the old config files for sites are moved to a new directory named php-7.4.1.

But if you change PHP version from 7.4.1 to 7.4.30 for other sites the old config files are moved to a new directory named php-7.4.30.

Is it a bug in the logic for naming the directory were the old config files are moved to? It happened for all my sites I changed to 7.4.30.

I’m running the latest macOS Monterey 12.6 and the new Local 6.4.3.

Another question about OPcache. Why is OPcache disabled now if you are running Apache? Is there a problem or can I still use it?

{{#unless apache}}
[opcache]
{{#if os.windows}}
zend_extension = php_opcache.dll
{{else}}
zend_extension = {{extensionsDir}}/opcache.so
{{/if}}
opcache.enable=1
opcache.enable_cli=1
{{/unless}}

Hey @emmtre -

:thinking: The first one is strange. We need to merge 7.4.1 and 7.4.30, along with 8.0.0 and 8.0.22, in the app, and that is a ticket the team is working on right now. (Let me know if you think there is value to keeping multiple patch versions of the same major/minor around!). It could be a side effect of Local having two options right now, but we’ll confirm and fix if it is a bug in the flow.

On the second - looking at the diffs, we didn’t make any changes to the Apache config this go around, so I believe it was like that previously. Have you tried removing that line and trying it out? There aren’t any issues off the top of my head, but I’ll go through past changes and see if I can find when that #unless apache got added.

@austinwendt Many thanx for the quick response.

It might be of value for developers to be able to download various minor versions of PHP in Local since many hosting providers are using different versions but I don’t know to which extent.

If you are changing between minor PHP versions (from 8.0.x to 8.0.y) I don’t see any reason not to use the same directory and config files you already have and you might have modified.

But I understand you have to create new config files and save the old when you are changing between major PHP versions. So just one directory for each ( php-7.4, php-8.0, php-8.1, etc.).

The #unless apache conditional in the config file php.ini.hbs can have been added several versions back but since you haven’t been able to change minor PHP version I haven’t notice before.

I have been running OPcache for some time without any problem so I was curious if there are any that I haven’t noticed and I should be aware of?

Sorry, I was too quick as there are several differences in the config file php.ini.hbs for different PHP versions.

Hi @emmtre - chiming in here on the first point about storing old configs in the wrong folder.

I did some digging, and it seems like this is in fact an issue with there being two different patch versions of PHP available and on your machine at the time of the swap. It will only occur when swapping between two patch versions (same major.minor versions).

However, it doesn’t look like we currently use these old config files again, even when swapping back to that older version. So this shouldn’t cause any bugs aside from confusion if you ever reference those files again. If you think you will, you should be able to just change the folder name - I’m curious, do you ever manually reuse those old configs files?

@adamperry Thanx for chiming in and that you are able to verify my observations.

I don’t know if this will be a problem or not when changing between PHP versions since the possibility have been limited until now.

I always keep changelogs and backups of config files but if you don’t I guess you will have problems if the config file is overwritten.

Usually I tend to tweak memory limits and maxes, add date timezone and comment out xdebug in the php config file to gain speed.

Because I have quite a few sites I created custom php config files and symlink the corresponding file to the config folder for each site.

Maybe this workflow will be enough so I don’t have to modify the php config file for all sites whenever I have to change php versions.

@adamperry I also noticed that the standard php config file have been adapted for the different php versions so you also have to consider that if you create custom php config files and change between different php versions within Local. I don’t see that you can do something differently to avoid that but maybe a warning text in the Local app that the config files will be overwritten when you apply a change of php version to a site?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.