Using mod_php7.c

Discussion in 'General' started by 737simpilot, Mar 6, 2017.

  1. 737simpilot

    737simpilot Member

    I am trying to get Ninja Firewall to work with my host that uses LiteSpeed. He states that perhaps LiteSpeed may be the issue and I want to confirm. Basically, I have a shared account. I can change the PHP version by adding code to my htaccess file. Right now I'm using PHP 5.6, but when I change to PHP 7, I can't log into Ninja Firewall. I asked Ninja Firewall support about this and they pointed me to this blog: https://blog.nintechnet.com/upgrading-to-php-7-with-ninjafirewall-installed/

    So I changed the htaccess code to use PHP 7:

    AddHandler application/x-httpd-php70 .php


    Then I added the code outlined in that blog to use Ninja Firewall with PHP 7:

    # BEGIN NinjaFirewall
    <IfModule mod_php7.c>
    php_value auto_prepend_file /home/systechf/public_html/firewall/firewall.php
    </IfModule>

    But when I go to log into the firewall I get a 503.

    Is there something to do with LiteSpeed and Ifmodule that isn't working right?
     
  2. Jon K

    Jon K Administrator Staff Member

  3. NiteWave

    NiteWave Administrator

    how about a simple phpinfo.php page ?
    and just remove <IfModule mod_php7.c></IfModule> ?
     
  4. 737simpilot

    737simpilot Member

    The Ninja Firewall blog that was pointed out to me by Ninja Firewall support specifies I use the ifmodule when using PHP 7. Currently, I do not use PHP 7, only PHP 5.6 and I don't use the ifmodule. With PHP 7 enabled in htaccess using the ifmodule or not I get a 503 trying to access the firewall login.

    I am just a sole user at a host that runs Litespeed. I'm here asking about this because my host mentoid that this issue could be Litespeed. So I'm doing my own research and seeking help from any and all channels because I just updated phpBB to 3.2 that is capable of using PHP 7. But with Ninja Firewall and/or the host throwing a fit about PHP 7, I am stuck using PHP 5.6 and I'd rather not be confined to that.

    PHP info here: https://www.dropbox.com/s/gl2v7tc8qe420q7/php.txt?dl=0
     
  5. NiteWave

    NiteWave Administrator

    does phpinfo.php work with php 7 + Ninja Firewall or return 503 as well ?
     
  6. 737simpilot

    737simpilot Member

    I'm able to see the PHP info file enabling PHP 7 in the htaccess with the firewall on.

    It's just that when PHP 7 is enabled I can't log into the firewall. I get a 503.
     
  7. Pong

    Pong Well-Known Member Staff Member

    You should log a ticket with your hosting company. 503 error is a php error and it is nothing to do with web server. You hosting company should look at server error log/stderr log and system log to see what caused the 503 error. It could be that Ninja Firewall doesn't support that particular php 7, or some PHP crash/bug. If core file generated, need to analyse as well. All the above troubling shootings require tmp ssh root password to the whole server, not just your ftp home user account.
     
    Last edited: Mar 9, 2017
  8. 737simpilot

    737simpilot Member

    So I have been talking to my host and I had them try this on their end with their own shared account and they too got a 503. They say there may be a parsing error or something else. I'm wondering if this could in fact be a Litespeed issue? Could you perhaps test Ninjafirewall with Litespeed with PHP 7? It works fine with PHP 5.6, you just can't access the firewall with PHP 7 on.
     
  9. Pong

    Pong Well-Known Member Staff Member

    As I said, 503 error is a PHP error code, nothing to do with a web server. It could be that some Ninjafirewall code caused a crash, or some PHP 7 modules installed caused the problem. For troubleshooting, please log a ticket with your hosting company, then they will need to log a ticket with us with temp root ssh access to the server.

    Actually, we have included most of the cases for 503 errors and detailed steps, if they follow along, they should be able to fix the problem as well:
    https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:php:503-errors
     
  10. Jon K

    Jon K Administrator Staff Member

    I have just tested NinjaFirewall in our lab and I currently do not get any 503 error. It seems something might be wrong with how your host has PHP setup and will want to contact them.
     
  11. 737simpilot

    737simpilot Member

    Okay, thank you very much for testing this for me. I just want to make sure. Were you using PHP 7?

    Sine I have a shared account I enable PHP 7 with a htaccess directive. So in effect I can change PHP versions on the fly by way of code added to my htaccess.

    Did you have to use the ifmodule? And you were able to log into the firewall?

    What OS BTW? I need as much info as possible so that I can pass this onto my host and maybe Ninjafirewall support. I have been in contact with my host and Ninjafirewall support. I would love to get this resolved so that I can use PHP 7 instead of PHP 5.6.

    Thanks for your time and effort.
     
  12. Jon K

    Jon K Administrator Staff Member

    Yes we used PHP 7 and we just had it enabled globally on the test server. The OS was CentOS.

    It seems as though your host has something enabled that ninjafirewall needs for 5.6 but not for 7.0. You can have them follow our guide and they should be able to narrow down the cause.
     

Share This Page