Opened 13 years ago

Last modified 20 months ago

#29849 new enhancement

php portgroup: add default configs to *.ini files

Reported by: BjarneDMat Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: portgroup Cc: chrstphrchvz (Christopher Chavez)
Port: php

Description

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 13 years ago.

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by BjarneDMat

Attachment: php5extension.tcl.diff added

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten 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.
extension=eaccelerator.so

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 13 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

comment:3 Changed 5 years ago by chrstphrchvz (Christopher Chavez)

The php5extension portgroup was deprecated in 2013. I think this ticket is no longer relevant unless it still applies to specific ports or the php 1.1 portgroup.

comment:4 Changed 5 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:5 in reply to:  3 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Port: php added; group php5extension removed
Summary: group php5extension - add default configs to *.ini filesphp portgroup: add default configs to *.ini files

Replying to BjarneDMat:

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 :-)

I don't remember if it was the case back when this comment was made 8 years ago, but today the user needs to specify which MySQL server's socket to use; the php-mysql port can't make that decision for the user.

Replying to chrstphrchvz:

The php5extension portgroup was deprecated in 2013. I think this ticket is no longer relevant unless it still applies to specific ports or the php 1.1 portgroup.

As far as I remember, no changes relating to the issues discussed here have been made in the php portgroup, so the issues raised are still relevant.

comment:6 Changed 20 months ago by mascguy (Christopher Nielsen)

Keywords: portgroup added

Add keyword portgroup, to pg-related tickets

Note: See TracTickets for help on using tickets.