Adding PORT option to Additional PHP Versions

Discussion in 'Developers' Forum' started by Aisfrond, Dec 12, 2015.

  1. Aisfrond

    Aisfrond New Member

    Hi all,
    first of all thanks for creating ispconfig.
    I'm trying to update ispconfig code to add php-fpm port to the 'additional php versions' because when you set up a new version (php 7, for example, as in here: happens that you have a 500 error because apache looks for php-fpm on port 9010 instead of your custom port (8999 in the tutorial mentioned).
    So I've already managed to add the field and the input in the 'Additional php versions' part and it is saved in db perfectly.
    Now I have to find where ispconfig writes the (in apache2 site-available) so that he considers the custom port instead of the 9010 port.
    When I'm done I'll post the hack and I hope this will help the development!
  2. Aisfrond

    Aisfrond New Member

  3. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig configures the ports automatically, there is no need for an additional port option. The port 8999 is and shall never be used by a ispcnfig website, the port 8999 is configured for the case that you want to run a debian package like phpmyadmin manually under this PHP version.

    If your php was not listening on port 9010 yet then probably the php-fpm reload failed. There is a open bugreport for that as php-fpm tends to fail to pick up the configuration on reload so we might have to change it to a restart instead. In your case, yust restart php fpm and you will see that the 500 error will be away.
  4. Aisfrond

    Aisfrond New Member

    thanks for your answer. My default version of php was correctly listening on port 9010 but when you want to add another php version, it has (I think) necessarely to be on a different port for different website that use different php version.
    For example uses defaule php 5.x (php-fpm) correctly on port 9010 uses php7 (php-fpm) on another port (for EXAMPLE 8999, but could be 8998 or any other non used port).
    It is exactly this example:
    Or this example:

    For what you say ispconfig would assign the correct port automatically for both sites in apache vhost configuration (/etc/apache2/sites-enabled/ ?
    Because if you say so, it really means that something else is wrong because on my debian it doesn't work that way.

    I'm looking forward to hear from you on this matter because I would really appreciate not having to put my hands one the code :)
    Thanks in advance!
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig configures a php-fpm pool for each website, so each site that uses php-fpm has its inique port, when you change the php version then the pool gets removed from default php (so it stops listening on that port) and then it gets added to the new php version (which then starts to listen on that port). I just tested it here on Debian 8 with the default php and php 7, works fine. There is definitely no code change required as it works on a few hundred thousand servers that use the current ISPConfig release.

    And dont forget that a socket is used by default, only if you enable the port checkbox on the options tab it will use a port (which is slower then the socket).

    1) Check that there are no pending jobs in the ispconfig jobqueue (see ispconfig monitor).
    2) Restart (not reload) both php-fpm demons.
  6. Aisfrond

    Aisfrond New Member

    Perfect, that's good news.
    I'll try again and I'll let you know.

Share This Page