[MacPorts] #26039: php5-5.3.3 Adding support to FPM
#26039: php5-5.3.3 Adding support to FPM --------------------------------+------------------------------------------- Reporter: info@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: php5 fpm | Port: php5 --------------------------------+------------------------------------------- Hey This diff file adds support to FPM with the fpm variant. It also registers a startup script for FPM. One thing I couldn't manage to change is FPM default configuration file being installed to ${prefix}/etc/php-fpm.conf.default Thanks. :) -- Ticket URL: <http://trac.macports.org/ticket/26039> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5-5.3.3 Adding support to FPM --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Changes (by jmr@…): * keywords: php5 fpm => haspatch * owner: macports-tickets@… => ryandesign@… * version: 1.9.1 => * cc: jwa@… (added) Comment: Please remember to cc the maintainers. -- Ticket URL: <http://trac.macports.org/ticket/26039#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5-5.3.3 Adding support to FPM --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by andy@…): I've updated this patch and done some additional testing. It now supports using the +apache2 and +fpm variants simultaneously, (using the same double-compile strategy as the fastcgi variant). It also fixes the startupitem, and gives some info on initial configuration. I'll bug the IRC channel to have this merged. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5-5.3.3 Adding support to FPM --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by andy@…): Added a few fixes to the Portfile, as well as a necessary patch, which modifies php-fpm.conf to keep from daemonizing and to properly save a pid. Fixes issues where launchctl kept trying to start it. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by ryandesign@…): The attached doesn't work for all combinations of variants, for example: {{{ sudo port install +fastcgi +fpm ---> Computing dependencies for php5 ---> Fetching php5 ---> Verifying checksum(s) for php5 ---> Extracting php5 ---> Applying patches to php5 ---> Configuring php5 ---> Building php5 ---> Staging php5 into destroot Error: Target org.macports.destroot returned: xinstall: Cannot stat: /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_php5/work/php-5.3.5/sapi/cgi /php-cgi, No such file or directory }}} The way the proposed patch handles the fpm config file is also not correct. The correct handling is how the port already handles the php.ini: it installs a sample configuration file, and advises the user where it is and that they should copy it if they want to use it. I've attached a slightly updated patch which corrects the handling of the config file, and changes some of the comments to mirror those of the FastCGI sections. I had wanted to wait on adding FPM support until I had separated each SAPI into its own port; see #19091. However Andy [http://bugs.php.net/bug.php?id=52419 pointed out] in his patch that PHP 5.4 will be able to properly build all SAPIs simultaneously. So maybe we keep all the SAPIs in one port after all, and just deal with the unpleasantness of multiple sequential builds until 5.4 is out. I fear there may need to be a drastic overhaul of how I do this, though, because I'm not happy with how each SAPI's options are basically specified twice in the portfile, and which version of the instructions is used depends on whether it is the only SAPI or not. I noticed the patch copies php-fpm into ${prefix}/sbin, whereas the FastCGI binary is copied into ${prefix}/bin. I imagine they should both be in the same directory, though not certain which directory it should be. sbin seems like the correct choice, but that would mean users using fastcgi would need to change their setups. :/ -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Changes (by ryandesign@…): * cc: stipsan@… (added) Comment: Has duplicate #29650. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:15> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by andreas@…): Are we ever getting fpm in macports? I think the way ubuntu does it is nice, thinking it would be cool with php5-fpm instead of php5 +fpm -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:16> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by ryandesign@…): I'm not familiar with how Ubuntu or other package managers do it, but what you've described sounds like what I planned to do; see #19091. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:18> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by andreas@…): Yeah something like that. I dont know how they do it either but they have php5-cgi , php5-cli, php5-fpm. Are we not getting fpm before 5.4 or how does your plan look like ryan? -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:19> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by ryandesign@…): I have no immediate plans to work on this issue. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:20> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by andy@…): FWIW, I gave up on maacports and have a great php-fpm setup running on homebrew. <http://mxcl.github.com/homebrew/> -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:21> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by andreas@…): I know about brew. Just didnt have the engery to get my fingers into it yet since i never really had any problems with macports. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:22> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by foolswisdom@…): ryandesign thank you for maintaining so many essential ports! I recently met the nginx developers and mentioned to them that I felt the lack of an official php fpm mac port is working against nginx adoption in PHP projects like the one I contribute to, WordPress. Whether this approach or #19091 is there something that they can do to assist getting an official php fpm port? It seems like resolving the issues you describe in 26039#comment:10 would be essential to get this moving forward. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:25> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by ryandesign@…): When using launchd, one does not want to daemonize. I'm working on a major rewrite of the php ports which will change how php fpm will be done in MacPorts. So hang on. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:28> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Changes (by ryandesign@…): * cc: christopher.pesto@… (added) Comment: I've been working on the afore-mentioned php port rewrite, currently underway in [browser:users/ryandesign/ports/lang/php54 the new php54 port in my user directory] of the repository. I just added the php54-fpm subport in r88174. It compiles for me. Can someone test whether it works, and/or let me know if the port should be printing some setup instructions? Should there be a startupitem? Instructions for testing: First time setup: Get the port definition: {{{ svn checkout https://svn.macosforge.org/repository/macports/users/ryandesign/ports/lang/p... }}} For all of the below you need to be in the php54 directory, i.e. do this first: {{{ cd php54 }}} To later update the port definition: {{{ svn update }}} To install the php fpm sapi: {{{ sudo port install subport=php54-fpm }}} To see what got installed: {{{ port contents php54-fpm }}} For now you have to deactivate your existing php ports first; I intend to correct this later. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:29> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by ryandesign@…): You will probably also need to install the main php54 port first with: {{{ cd php54 sudo port install }}} -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:30> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by aziz.elezaby@…): ryan do you still need testers? I've got a virtual environment setup if that's still the case. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:31> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by MailToArlo@…): I've successfully installed the fpm subport together with the apache2handler. I've had no issues on my local environment. In my opinion there should be some setup instructions as well as a StartupItem. I have created a patch containing these two additions. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:33> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Changes (by ryandesign@…): * cc: MailToArlo@… (added) Comment: I committed a different version of these changes in r89882. fpm seems to work. But the error log file is always empty, even if I load a PHP file with an error in it. Not sure if I've done something wrong there. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:34> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------------+------------------------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: haspatch | Port: php5 --------------------------------+------------------------------------------- Comment(by MailToArlo@…): I could successfully install that revision. Would a PHP error actually show up in the php-fpm logs? Shouldn't that show up in the file specified by php.ini's error_log directive? But still php-fpm prints no logs. As far as I can see the problem is that with daemonize=no the logs are printed only to stdout/err. IMHO daemonize=yes should be used together with the wrapper shell script provided by php-fpm which I've used in my patch. For sudo load to work without an existing config the {{{ --with-fpm-pid }}} [http://php-fpm.org/wiki/Configuration_File] compile option can be used. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:35> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support ---------------------------------+------------------------------------------ Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: haspatch Port: php5 | ---------------------------------+------------------------------------------ Changes (by ryandesign@…): * status: new => closed * resolution: => fixed Comment: php53-fpm and php54-fpm have been in the ports tree for awhile. For any remaining issues please file new tickets. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:39> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26039: php5: add fpm support --------------------------+-------------------------- Reporter: info@… | Owner: ryandesign@… Type: enhancement | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: haspatch Port: php5 | --------------------------+-------------------------- Comment (by ryandesign@…): Has duplicate #37475. -- Ticket URL: <https://trac.macports.org/ticket/26039#comment:40> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts