MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Bugs and Requests => Topic started by: amitkumar on 2016-05-25, 11:55:20

Title: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-25, 11:55:20
Hello,

i have tested on my vps.
After update and previous version.

I got issue of webmail.

When i open webmail , ns1 , ns2

php code is not executing

i have tried
yum clean all
yum update -y
sh /script/cleanup
etc reboot


sh /script/sysinfo
A. Control Panel:
   - Kloxo-MR: 7.0.0.b-2016052503
   - Web: hiawatha-10.2.0-f.6.mr.el6.x86_64
   - PHP: php54s-5.4.45-1.ius.el6 (fpm mode)
B. Plateform:
   - OS: CentOS release 6.7 (Final) x86_64
   - Hostname: XXXXXXXXXXXXXXXXXXXXXXXXXX
C. Services:
   1. MySQL: MariaDB-server-10.0.25-1.el6.x86_64
   2. PHP:
      - Branch: php54-cli-5.4.45-1.ius.el6.x86_64
      - Used: --Use PHP Branch--
   3. Web Used: nginxproxy
     - Hiawatha: --unused--
     - Lighttpd: --uninstalled--
     - Nginx: nginx-1.11.0-1.el6.ngx.x86_64
     - Httpd: httpd-2.2.31-1.mr.el6.x86_64
       - PHP Type: php-fpm_event
   4. WebCache: none
     - ATS: --uninstalled--
     - Squid: --uninstalled--
     - Varnish: --uninstalled--
   5. Dns: bind
     - Bind: bind-9.9.7-1.mr.el6.x86_64
     - DJBDns: --uninstalled--
     - NSD: --uninstalled--
     - PowerDNS: --uninstalled--
     - Yadifa: --uninstalled--
   6. Mail: qmail-toaster-1.03-1.3.55.mr.el6.x86_64
      - pop3/imap4: courier-imap-toaster-4.1.2-1.3.18.mr.el6.x86_64
      - spam: bogofilter
D. Memory:
                total       used       free     shared    buffers     cached
   Mem:          1829        507       1322          0         23        235
   -/+ buffers/cache:        248       1580
   Swap:            0          0          0
E. Disk Space:
   Filesystem      Size  Used Avail Use% Mounted on
   /dev/vda1       9.8G  2.3G  7.0G  25% /



<?php
   ini_set("display_errors","1");

   if (file_exists("./custom-index.php")) {
      include_once "./custom-index.php";
   } elseif (file_exists("./custom.index.php")) {
      include_once "./custom.index.php";
   } else {

      if (file_exists("./custom-inc.php")) {
         $incfile = "./custom-inc.php";
      } elseif (file_exists("./custom.inc.php")) {
         $incfile = "./custom.inc.php";
      } else {
         if (file_exists("./inc.php")) {
            $incfile = "./inc.php";
         }
      }

      if (file_exists("./custom-inc2.php")) {
         $incfile2 = "./custom-inc2.php";
      } elseif (file_exists("./custom.inc2.php")) {
         $incfile = "./custom.inc2.php";
      } else {
         if (file_exists("./inc2.php")) {
            $incfile2 = "./inc2.php";
         }
      }

      if (file_exists("./images/user-logo.png")) {
         $logo_url = "./images/user-logo.png";
      } else {
         $logo_url = "./images/logo.png";
      }
?>
<html>

<head>
   <meta http-equiv="Content-Language" content="en-us" />
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php

      if(isset($incfile2)) { include_once $incfile2 ; }

      if (isset($page)) {
         $title = "Kloxo-MR {$page} page";
      } else {
         $title = "Kloxo-MR Page";
      }

      $bckgrnd = "\tbackground-image: url(./images/abstract.jpg);";

      $path = "../theme/background";

      // MR -- trick to make random background for login
      if ((file_exists($path)) && (!file_exists("./.norandomimage"))) {
         try {
            $dirs = glob("{$path}/*", GLOB_MARK);

            if ($dirs) {
               $count = count($dirs);
               $selnum = rand(0, ($count - 1));

               $selimg = $dirs[$selnum];

               $bckgrnd = "\tbackground-image: url({$selimg});\n".
                  "\tbackground-size: cover;\n".
                  "\tbackground-attachment: fixed;";
            }
         } catch (Exception $e) {
            $bckgrnd = $bckgrnd;
         }
      }

?>
   <title><?= $title; ?></title>
<style>
body {
   font-family: Tahoma, Verdana, Arial, Helvertica, sans-serif;
   font-size: 8pt;
   font-weight: 100;
<?= $bckgrnd; ?>

   background-color:#cccccc;
   margin: 0;
}
a {
   text-decoration: none;
}
img {
   border: 0;
}

img.logo {
   margin: 5px;
   padding: 0;
}

table.header {
   border-collapse: collapse;
   border-spacing: 0;
   width: 100%;
   font-family: Tahoma, Verdana, Arial, Helvertica, sans-serif;
   font-size: 8pt;
   font-weight: 100;
}

table.content {
   border-collapse: collapse;
   border-spacing: 0;
   width: 100%;
   /* height: 100%; */
   font-family: Tahoma, Verdana, Arial, Helvertica, sans-serif;
   font-size: 8pt;
   font-weight: 100%;
}

table.content_body td {
   border-collapse: collapse;
   border: 1px dashed #cccccc;
   font-family: Tahoma, Verdana, Arial, Helvertica, sans-serif;
   font-size: 10pt;
   color: #444444;
   padding:10px;
   spacing:0;
}

table.content_title td {
   border-collapse: collapse;
   border: 0;
   font-family: Tahoma, Verdana, Arial, Helvertica, sans-serif;
   font-size: 12pt;
   color: #336699;
}

</style>

</head>

<body>

<table class="header">
   <tr>
      <td width="100%"><img style="margin:5px; padding:5px; height:50px" class="logo" src="<?php echo $logo_url; ?>" alt="hosting-logo"></td>
      <td><a href="http://mratwork.com/work/" title="Go to Kloxo-MR website"><img style="margin:5px; padding:5px; height:50px" class="logo" src="./images/kloxo-mr.png" alt="kloxo-mr-logo"></a></td>
   </tr>
</table>
<table class="content">
   <tr>
      <td width="50">&nbsp;</td>
      <td valign="middle" width="100%"><?php include_once $incfile; ?></td>
      <td width="50">&nbsp;</td>
   </tr>
</table>
</body>

</html>
<?php
      }
?>
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: MRatWork on 2016-05-25, 13:00:39
Make sure use latest one. And try 'sh /script/set-php-fpm'.
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-25, 18:10:34
yes i have updated the kloxmr to latest one
Kloxo-MR 7.0.0.b-2016052503

still getting issue




Error 500 - Internal Server Error

A generic error message, given when no more specific message is suitable


and php file also saying the same message. 500
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: lanuma on 2016-05-25, 18:27:31
yes i have updated the kloxmr to latest one
Kloxo-MR 7.0.0.b-2016052503

still getting issue




Error 500 - Internal Server Error

A generic error message, given when no more specific message is suitable


and php file also saying the same message. 500

try 'sh /script/set-php-fpm'.
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-25, 19:16:49
Getting this error while using below command

Quote
sh /script/set-php-fpm

- For help, type 'sh /script/set-php-fpm --help'
- No argument supplied. Defaulting to localhost (master) servers

- No argument and then use 'PHP Branch'
Stopping php-fpm (for 'PHP Used'):                         [FAILED]
Starting php-fpm (for 'PHP Used'): [25-May-2016 13:27:47] ERROR: Unable to globalize '/opt/configs/php-fpm/conf/php/*.conf' (ret=2) from /etc/php-fpm.conf at line 18.
[25-May-2016 13:27:47] ERROR: failed to load configuration file '/etc/php-fpm.conf'
[25-May-2016 13:27:47] ERROR: FPM initialization failed
                                                           [FAILED]
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-25, 19:30:17
i have copied my previous server php-fpm.conf and problem solved  .
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-25, 19:45:30
after reboot  again 500 error

new one not working

[global]
pid=/var/run/php-fpm/php-fpm.pid
error_log=/var/log/php-fpm/error.log
log_level=error

;emergency_restart_threshold=0
;emergency_restart_interval=0
;process_control_timeout=0

emergency_restart_threshold=10
emergency_restart_interval=1m
process_control_timeout=10s

events.mechanism=epoll

daemonize=yes

include=/opt/configs/php-fpm/conf/php/*.conf

---
old one working


[global]
pid=/var/run/php-fpm/php-fpm.pid
error_log=/var/log/php-fpm/error.log
log_level=error

;emergency_restart_threshold=0
;emergency_restart_interval=0
;process_control_timeout=0

emergency_restart_threshold=10
emergency_restart_interval=1m
process_control_timeout=10s

events.mechanism=epoll

daemonize=yes

include=/etc/php-fpm.d/*.conf
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: MRatWork on 2016-05-26, 01:58:06
Different is 'include'.
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-26, 15:33:28
Yes

include location issue.

After fixed all thing are working fine.
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-26, 15:49:11
my webmail.domain.com

showing all webmail but when i click anyone of one its show an error

The webmail.domain.com page isn’t working

webmail.domain.com is currently unable to handle this request.
HTTP ERROR 500
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: Wibowo on 2016-05-26, 17:55:57
my webmail.domain.com
showing all webmail but when i click anyone of one its show an error
The webmail.domain.com page isn’t working
webmail.domain.com is currently unable to handle this request.
HTTP ERROR 500

same here
only telaen and squirrel mail is working
http error log says

Code: [Select]
[Thu May 26 23:09:16 2016] [-:error] [pid 21412] [fcgi_protocol.c(441):] [FastCGI: server "/home/kloxo/httpd/webmail/webmail.hostmikro.com.1fake" stderr: PHP message: PHP Fatal error:  Call to undefined function xml_parser_create() in /home/kloxo/httpd/webmail/afterlogic/libraries/afterlogic/common/xml.php on line 237] [webmail.hostmikro.com]
[Thu May 26 23:09:20 2016] [-:error] [pid 21412] [fcgi_protocol.c(441):] [FastCGI: server "/home/kloxo/httpd/webmail/webmail.hostmikro.com.1fake" stderr: PHP message: PHP Fatal error:  Call to undefined function xml_parser_create() in /home/kloxo/httpd/webmail/afterlogic/libraries/afterlogic/common/xml.php on line 237] [webmail.hostmikro.com]
[Thu May 26 23:09:33 2016] [-:error] [pid 21412] [fcgi_protocol.c(441):] [FastCGI: server "/home/kloxo/httpd/webmail/webmail.hostmikro.com.1fake" stderr: PHP message: PHP Fatal error:  Class 'PDO' not found in /home/kloxo/httpd/webmail/roundcube/program/lib/Roundcube/rcube_db_mysql.php on line 144] [webmail.hostmikro.com]
[Thu May 26 23:09:33 2016] [-:error] [pid 21412] [fcgi_protocol.c(441):] [FastCGI: server "/home/kloxo/httpd/webmail/webmail.hostmikro.com.1fake" stderr: PHP message: PHP Fatal error:  Class 'PDO' not found in /home/kloxo/httpd/webmail/roundcube/program/lib/Roundcube/rcube_db_mysql.php on line 144] [webmail.hostmikro.com]
[Thu May 26 23:09:40 2016] [-:error] [pid 21413] [fcgi_protocol.c(441):] [FastCGI: server "/home/kloxo/httpd/webmail/webmail.hostmikro.com.1fake" stderr: PHP message: PHP Notice:  Undefined variable: tid in /home/kloxo/httpd/webmail/telaen/inc/user_tl.php on line 37] [webmail.hostmikro.com]
[Thu May 26 23:09:40 2016] [-:error] [pid 21413] [fcgi_protocol.c(441):] [FastCGI: server "/home/kloxo/httpd/webmail/webmail.hostmikro.com.1fake" stderr: PHP message: PHP Notice:  Undefined variable: lid in /home/kloxo/httpd/webmail/telaen/inc/user_tl.php on line 38] [webmail.hostmikro.com]
[Thu May 26 23:09:40 2016] [-:error] [pid 21413] [fcgi_protocol.c(441):] [FastCGI: server "/home/kloxo/httpd/webmail/webmail.hostmikro.com.1fake" stderr: PHP message: PHP Notice:  Undefined variable: f_email in /home/kloxo/httpd/webmail/telaen/index.php on line 118] [webmail.hostmikro.com]
[Thu May 26 23:09:40 2016] [-:error] [pid 21413] [fcgi_protocol.c(441):] [FastCGI: server "/home/kloxo/httpd/webmail/webmail.hostmikro.com.1fake" stderr: PHP message: PHP Notice:  Undefined variable: f_user in /home/kloxo/httpd/webmail/telaen/index.php on line 119] [webmail.hostmikro.com]
[Thu May 26 23:09:40 2016] [-:error] [pid 21413] [fcgi_protocol.c(441):] [FastCGI: server "/home/kloxo/httpd/webmail/webmail.hostmikro.com.1fake" stderr: PHP message: PHP Notice:  Undefined variable: f_pass in /home/kloxo/httpd/webmail/telaen/index.php on line 120] [webmail.hostmikro.com]
[Thu May 26 23:10:12 2016] [-:error] [pid 21413] [fcgi_protocol.c(441):] [FastCGI: server "/home/kloxo/httpd/webmail/webmail.hostmikro.com.1fake" stderr: PHP message: PHP Fatal error:  Call to undefined function xml_parser_create() in /home/kloxo/httpd/webmail/afterlogic/libraries/afterlogic/common/xml.php on line 237] [webmail.hostmikro.com]
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: MRatWork on 2016-05-26, 18:37:36
Try reinstall with 'yum reinstall kloxomr-webmail* -y; sh /script/fixmail-all'.
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-26, 19:32:31
i did that sir but still get the issue

webmail.domain.com

shows all the panels but when i click on it ,

its show 500 error.
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: MRatWork on 2016-05-26, 19:41:07
Inform here 'sh /script/sysinfo'. Better also inform your domain where have webmail trouble.
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: Wibowo on 2016-05-26, 20:18:51
same here
still not working after 'yum reinstall kloxomr-webmail* -y; sh /script/fixmail-all'.

[root@user~]# sh /script/sysinfo
A. Control Panel:
   - Kloxo-MR: 7.0.0.b-2016052507
   - Web: hiawatha-10.2.0-f.6.mr.el6.x86_64
   - PHP: php54s-5.4.45-1.ius.el6 (fpm mode)
B. Plateform:
   - OS: CentOS release 6.8 (Final) x86_64
   - Hostname: user.mydomain.com
C. Services:
   1. MySQL: MariaDB-server-10.0.25-1.el6.x86_64
   2. PHP:
      - Branch: php56u-cli-5.6.21-1.ius.el6.x86_64
      - Multiple:
        * php54m-5.4.45-1.ius.el6
        * php56m-5.6.21-1.ius.el6
        * php70m-7.0.6-1.w6
      - Used: --Use PHP Branch--
   3. Web Used: nginxproxy
     - Hiawatha: --unused--
     - Lighttpd: --uninstalled--
     - Nginx: nginx-1.11.0-1.el6.ngx.x86_64
     - Httpd: httpd24u-2.4.20-1.ius.el6.x86_64
       - PHP Type: php-fpm_event
   4. WebCache: none
     - ATS: --uninstalled--
     - Squid: --uninstalled--
     - Varnish: --uninstalled--
   5. Dns: nsd
     - Bind: --uninstalled--
     - DJBDns: --uninstalled--
     - NSD: nsd-4.1.9-1.mr.el6.x86_64
     - PowerDNS: --uninstalled--
     - Yadifa: --uninstalled--
   6. Mail: qmail-toaster-1.03-1.3.55.mr.el6.x86_64
      - pop3/imap4: courier-imap-toaster-4.1.2-1.3.18.mr.el6.x86_64
      - spam: bogofilter
D. Memory:
                total       used       free     shared    buffers     cached
   Mem:          1829       1612        217         48        110       1084
   -/+ buffers/cache:        416       1412
   Swap:            0          0          0
E. Disk Space:
   Filesystem      Size  Used Avail Use% Mounted on
   /dev/vda1       9.8G  4.0G  5.4G  43% /


*** Process Time: 00:00:00:02.2184 (dd:hh:mm:ss:xxxxxx) ***

* Note: run 'sh /script/sysinfo -y' if you want run 'fix-service-list' also
        (importance after Kloxo-MR update)

Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: MRatWork on 2016-05-26, 20:24:55
I found couldn't login to webmail. But, need reset email password.
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-26, 20:33:44
@ Wibowo

php7 doesnt support many webmail iteam so try to use php 5.4 etc
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: Wibowo on 2016-05-26, 20:43:42
@ Wibowo

php7 doesnt support many webmail iteam so try to use php 5.4 etc

php7 used inside root domain folder with .htaccess
using php56u as my php branch because my php script can't run with version less than php55

======================edit===================

problem with php xml module
solved by reinstalling my php56u-xml module
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: Spacedust on 2016-05-26, 23:29:02
I use PHP7 for afterlogic and it works perfectly ;)
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-27, 08:17:11
while installation new kloxomr7

Please solve the include file location fresh install also have this issue

[global]
pid=/var/run/php-fpm/php-fpm.pid
error_log=/var/log/php-fpm/error.log
log_level=error

;emergency_restart_threshold=0
;emergency_restart_interval=0
;process_control_timeout=0

emergency_restart_threshold=10
emergency_restart_interval=1m
process_control_timeout=10s

events.mechanism=epoll

daemonize=yes

include=/opt/configs/php-fpm/conf/php/*.conf

Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-27, 08:37:56
Here is fresh install server sysinfo webmail is not working

sh /script/sysinfo -y
A. Control Panel:
   - Kloxo-MR: 7.0.0.b-2016052507
   - Web: hiawatha-10.2.0-f.6.mr.el6.x86_64
   - PHP: php54s-5.4.45-1.ius.el6 (fpm mode)
B. Plateform:
   - OS: CentOS release 6.8 (Final) x86_64
   - Hostname: vps
C. Services:
   1. MySQL: MariaDB-server-10.0.25-1.el6.x86_64
   2. PHP:
      - Branch: php54-cli-5.4.45-1.ius.el6.x86_64
      - Used: --Use PHP Branch--
   3. Web Used: apache
     - Hiawatha: --unused--
     - Lighttpd: --uninstalled--
     - Nginx: --uninstalled--
     - Httpd: httpd-2.2.31-1.mr.el6.x86_64
       - PHP Type: [unknown]
   4. WebCache: none
     - ATS: --uninstalled--
     - Squid: --uninstalled--
     - Varnish: --uninstalled--
   5. Dns: bind
     - Bind: bind-9.9.7-1.mr.el6.x86_64
     - DJBDns: --uninstalled--
     - NSD: --uninstalled--
     - PowerDNS: --uninstalled--
     - Yadifa: --uninstalled--
   6. Mail: qmail-toaster-1.03-1.3.55.mr.el6.x86_64
      - pop3/imap4: courier-imap-toaster-4.1.2-1.3.18.mr.el6.x86_64
      - spam: bogofilter
D. Memory:
                total       used       free     shared    buffers     cached
   Mem:          1829        619       1210          0         30        324
   -/+ buffers/cache:        264       1564
   Swap:            0          0          0
E. Disk Space:
   Filesystem      Size  Used Avail Use% Mounted on
   /dev/vda1       9.8G  2.4G  6.9G  26% /


*** Process Time: 00:00:00:43.43249 (dd:hh:mm:ss:xxxxxx) ***

* Note: run 'sh /script/sysinfo -y' if you want run 'fix-service-list' also
        (importance after Kloxo-MR update)


------------------------

this to have php fpm include location error . as well as on webmail page php executing is not working .

------------ Now i can see webmail after , roundcube etc.. same issue when i click on it, showing 500 error and on firefox it showing blank page.
MR sir if you want i can provide you root details.
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: MRatWork on 2016-05-27, 10:34:15
1. Set hostname 'vps.yourrealdomain.com' instead 'vps'
2. Set 'php type' as 'php-fpm_event' in 'webserver configure' and enable 'enable secondary php'
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-27, 15:05:06
my i have edited that hostname line
server.domain.xyz

and i didn't try the secondary php.

Sir, Can use also fix that include error in next update. I am really pissed of because of that error. Usually i get 500 error after fixing of include of /etc/php-fpm all things work fine expect webmail .
Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: Wibowo on 2016-05-28, 18:50:54
reinstalling php56u-xml didn't solve the problem permanently
it happened again few hours ago and i need to reinstall php56u-xml again

Title: Re: Confirm bug php code not working on webmail ns1 ns2 pages
Post by: amitkumar on 2016-05-28, 19:23:01
Finally everything is fine.

Thank you MR sir..

---

Enabling secondary php and also use the sh /script/fix-all command

after installation we have to change etc/php-fpm

include location ...