Opened 7 years ago

Last modified 7 years ago

#29849 new enhancement

group php5extension - add default configs to *.ini files

Reported by: BjarneDMat Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc:
Port: group php5extension


a lot of php5 extension require some default settings in order to work properly. this suggestion adds the possibility to ad a php_default.ini file placed in the files directory to the extension.ini file

Attachments (1)

php5extension.tcl.diff (2.1 KB) - added by BjarneDMat 7 years ago.

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by BjarneDMat

Attachment: php5extension.tcl.diff added

comment:1 Changed 7 years ago by ryandesign (Ryan Schmidt)

Cc: ryandesign@… removed
Owner: changed from macports-tickets@… to ryandesign@…

Do not increase the version of the portgroup.

The problem with this suggestion is that the user is not meant to modify the configuration file the portgroup installs. For example php5-eaccelerator's eaccelerator.ini file reads:

; Do not edit this file; it is automatically generated by MacPorts.
; Any changes you make will be lost if you upgrade or uninstall php5-eaccelerator.
; To configure PHP, edit /opt/local/etc/php5/php.ini.

Therefore, we do not want to put default settings into that file, if the user would need to edit them there, since the changes will not persist.

So I don't want to put default settings in the extension's ini file, unless there is a well-defined way for users to override them by editing another file. For example, do we know the order in which all the ini files are processed? If we can guarantee that the main php.ini is processed after all the extensions' ini files, then the user can customize extensions' settings in php.ini, just as we've always recommended, but I don't know if that's the case. Or, if we can guarantee that the extensions' ini files are processed in, say, alphabetical order, then we can tell the user to put their custom extension settings into a file whose name comes alphabetically after the extension's ini file.

comment:2 Changed 7 years ago by BjarneDMat

My intention is to only put stuff into those *.ini-files that no normal user would want to change.

For instance, for php5-mysql a message is printed stating one has to insert three instances of the path to the mysqld.sock into the php.ini file. I'm of the opinion that MacPorts ought to do that automagically :-)

And php5-eaccelerator needs some directories and files defined in order to work properly out-of-the-box. By default php5-eaccelerator uses /tmp/eaccelleator with which there are three issues:

  1. this is outside the MacPorts file system and isn't recommended
  2. the directory doesn't exist with the result that eaccelerator fails to cache
  3. with no log defined, the log is written to the standard apache error-log

php reads the *.ini files in /macports/var/db/php5 alfabetically

furthermore, you can override settings both at the httpd.conf level for the whole server as well as for individual virtual servers and these override the standard *.ini-files

Note: See TracTickets for help on using tickets.