playSMS Forum

[solved] playSMS and php7 won't play nice


(Cristi C) #1

looks like playSMS and php7 won’t play nice

any time frame on supporting php7

thanks


(Steven Delport) #2

Have you got it working on php7 ?
I had it working on php 5.4 upgraded to 7 now its broken.


(Anton Raharja) #3

Im using Ubuntu 16 with php7 and while I wrote for 1.4 I changed things in playSMS to made it work with my laptop

So it should be ok. Probably not php7, did u also upgrade mysql to 5.7?

Anton


(Anton Raharja) #4

hmm… I’m writing a tutorial for Ubuntu 16.04 and php7.0, I do find something, I’ll just write pieces I found here and then put them together later.

I’m using Nginx with php7.0-fpm, and PHP_SELF is empty, so I need to change this:

Edit init.php and go to line 73, change:

$c_php_self = $_SERVER['PHP_SELF'];

To this:

$c_php_self = $_SERVER['SCRIPT_NAME'];

I also use MySQL 5.7, and I need to do this:

Edit /etc/mysql/mysql.conf.d/mysqld.cnf and add this option at the end of the file:

sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

And then restart MySQL server.

anton


(Anton Raharja) #5

ok, here is the article:

anton


(Steven Delport) #6

Running mariadb-5.5.47-1.el7_2.x86_64 maybe I will upgrade to 10 and report back.


(Steven Delport) #7

Unable to login mariadb 10.1 PHP 7.0.9
I will go through the Ubuntu tutorial and see what I can learn.
logfile only deamon stuff here.

    • 2016-07-22 07:23:55 PID5791c9e4b627a - L4 dba__query # q:SELECT registry_key, registry_value FROM playsms_tblRegistry WHERE uid=‘1’ AND registry_group=‘core’ AND registry_family=‘main_config’
    • 2016-07-22 07:23:55 PID5791c9e4b627a - L4 dba__query # q:SELECT language_module FROM playsms_tblUser WHERE flag_deleted=‘0’ AND username=’’
    • 2016-07-22 07:23:55 PID5791c9e4b627a - L4 dba__query # q:SELECT id, queue_code FROM playsms_tblSMSOutgoing_queue WHERE flag=‘0’ LIMIT 10
    • 2016-07-22 07:23:55 PID5791c9e4b627a - L4 dba__query # q:SELECT id, queue_code FROM playsms_tblSMSOutgoing_queue WHERE flag=‘3’ LIMIT 10
    • 2016-07-22 07:23:56 PID5791c9e49f0c1 - L4 dba__query # q:SET NAMES utf8

(Steven Delport) #8

I read it made the changes still something small unable to login with php7
php7 and mariadb I think. tried 5.5 & 10.1
now running php-fpm-7.0.9 nginx-1.10.1

With php 7 both
$_SERVER[‘SCRIPT_NAME’]
$_SERVER[‘PHP_SELF’]
returns the same value what’s the difference ?


(Anton Raharja) #9

SCRIPT_NAME not SCRIPT_NAME

You saw the Unable to login error message ? Sometime by exitting the browser and re login helps

Anton


(Steven Delport) #10

This is what I am getting.
Array
(
[_GET] => Array
(
[app] => main
[inc] => core_auth
[route] => login
)

[_POST] => Array
    (
    )

[_COOKIE] => Array
    (
        [PHPSESSID] => i4d9evmgpa0gtht9tnoatvdmp7
        [main_config_last_tab] => #tabs-site-configuration
    )

[_FILES] => Array
    (
    )

[_REQUEST] => Array
    (
        [app] => main
        [inc] => core_auth
        [route] => login
    )

[core_config] => Array
    (
        [db] => Array
            (
                [type] => mysqli
                [host] => localhost
                [port] => 3306
                [user] => xxxxx
                [pass] => xxxxx
                [name] => smsdb
                [pref] => playsms
            )

        [smtp] => Array
            (
                [relm] => 
                [user] => 
                [pass] => 
                [host] => localhost
                [port] => 25
            )

        [apps_path] => Array
            (
                [logs] => /var/log/playsms
            )

        [logstate] => 4
        [logfile] => playsms.log
        [logaudit] => 1
        [logauditfile] => audit.log
        [ishttps] => 
        [isdlrd] => 1
        [dlrd_limit] => 1000
        [isrecvsmsd] => 1
        [recvsmsd_limit] => 1000
        [issendsmsd] => 1
        [sendsmsd_queue] => 10
        [sendsmsd_chunk] => 20
        [sendsmsd_chunk_size] => 100
        [webservices_username] => 1
        [daemon_process] => 
    )

[_SERVER] => Array
    (
        [USER] => nginx
        [HOME] => /var/cache/nginx
        [HTTP_CONNECTION] => keep-alive
        [HTTP_COOKIE] => PHPSESSID=i4d9evmgpa0gtht9tnoatvdmp7; main_config_last_tab=%23tabs-site-configuration
        [HTTP_REFERER] => http://sms.nip.it.na/index.php?app=main&inc=core_auth&route=login
        [HTTP_ACCEPT_ENCODING] => gzip, deflate
        [HTTP_ACCEPT_LANGUAGE] => en
        [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
        [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
        [HTTP_HOST] => sms.nip.it.na
        [REDIRECT_STATUS] => 200
        [SERVER_NAME] => sms.nip.it.na
        [SERVER_PORT] => 80
        [SERVER_ADDR] => 10.2.4.7
        [REMOTE_PORT] => 53279
        [REMOTE_ADDR] => 41.182.84.185
        [SERVER_SOFTWARE] => nginx/1.10.1
        [GATEWAY_INTERFACE] => CGI/1.1
        [REQUEST_SCHEME] => http
        [SERVER_PROTOCOL] => HTTP/1.1
        [DOCUMENT_ROOT] => /home/sms
        [DOCUMENT_URI] => /index.php
        [REQUEST_URI] => /index.php?app=main&inc=core_auth&route=login
        [SCRIPT_NAME] => /index.php
        [CONTENT_LENGTH] => 
        [CONTENT_TYPE] => 
        [REQUEST_METHOD] => GET
        [QUERY_STRING] => app=main&inc=core_auth&route=login
        [SCRIPT_FILENAME] => /home/sms/index.php
        [FCGI_ROLE] => RESPONDER
        [PHP_SELF] => /index.php
        [REQUEST_TIME_FLOAT] => 1469178468.7878
        [REQUEST_TIME] => 1469178468
    )

[version] => Array
    (
        [0] => 7
        [1] => 0
        [2] => 9
    )

[c_script_filename] => /home/sms/init.php
[c_php_self] => /index.php
[c_http_host] => sms.nip.it.na
[_SESSION] => Array
    (
    )

)
Do you see anything in this.


(Steven Delport) #11

DUMP does it not looked logged in ?
array(90) { ["_GET"]=> array(3) { [“app”]=> string(4) “main” [“inc”]=> string(9) “core_auth” [“route”]=> string(5) “login” } ["_POST"]=> array(0) { } ["_COOKIE"]=> array(2) { [“PHPSESSID”]=> string(26) “i4d9evmgpa0gtht9tnoatvdmp7” [“main_config_last_tab”]=> string(24) “#tabs-site-configuration” } ["_FILES"]=> array(0) { } ["_REQUEST"]=> array(3) { [“app”]=> string(4) “main” [“inc”]=> string(9) “core_auth” [“route”]=> string(5) “login” } [“core_config”]=> array(24) { [“db”]=> array(7) { [“type”]=> string(6) “mysqli” [“host”]=> string(9) “localhost” [“port”]=> string(4) “3306” [“user”]=> string(4) “root” [“pass”]=> string(9) “nip435nam” [“name”]=> string(5) “smsdb” [“pref”]=> string(7) “playsms” } [“smtp”]=> array(5) { [“relm”]=> string(0) “” [“user”]=> string(0) “” [“pass”]=> string(0) “” [“host”]=> string(9) “localhost” [“port”]=> string(2) “25” } [“apps_path”]=> array(8) { [“logs”]=> string(16) “/var/log/playsms” [“base”]=> string(9) “/home/sms” [“libs”]=> string(13) “/home/sms/lib” [“incs”]=> string(13) “/home/sms/inc” [“plug”]=> string(16) “/home/sms/plugin” [“themes”]=> string(23) “/home/sms/plugin/themes” [“tpl”]=> string(40) “/home/sms/plugin/themes/common/templates” [“storage”]=> string(17) “/home/sms/storage” } [“logstate”]=> int(4) [“logfile”]=> string(11) “playsms.log” [“logaudit”]=> bool(true) [“logauditfile”]=> string(9) “audit.log” [“ishttps”]=> bool(false) [“isdlrd”]=> bool(true) [“dlrd_limit”]=> int(1000) [“isrecvsmsd”]=> bool(true) [“recvsmsd_limit”]=> int(1000) [“issendsmsd”]=> bool(true) [“sendsmsd_queue”]=> int(10) [“sendsmsd_chunk”]=> int(20) [“sendsmsd_chunk_size”]=> int(100) [“webservices_username”]=> bool(true) [“daemon_process”]=> NULL [“http_path”]=> array(7) { [“base”]=> string(21) “http://sms.nip.it.na/” [“libs”]=> string(25) “http://sms.nip.it.na//lib” [“incs”]=> string(25) “http://sms.nip.it.na//inc” [“plug”]=> string(28) “http://sms.nip.it.na//plugin” [“themes”]=> string(35) “http://sms.nip.it.na//plugin/themes” [“tpl”]=> string(52) “http://sms.nip.it.na//plugin/themes/common/templates” [“storage”]=> string(29) “http://sms.nip.it.na//storage” } [“plugins”]=> array(2) { [“list”]=> array(1) { [“core”]=> array(19) { [0]=> string(3) “acl” [1]=> string(4) “auth” [2]=> string(9) “blacklist” [3]=> string(7) “country” [4]=> string(3) “dba” [5]=> string(7) “gateway” [6]=> string(6) “logger” [7]=> string(11) “main_config” [8]=> string(5) “notif” [9]=> string(7) “recvsms” [10]=> string(8) “registry” [11]=> string(9) “sender_id” [12]=> string(8) “sendmail” [13]=> string(7) “sendsms” [14]=> string(4) “site” [15]=> string(6) “themes” [16]=> string(3) “tpl” [17]=> string(4) “user” [18]=> string(7) “welcome” } } [“category”]=> array(4) { [0]=> string(7) “feature” [1]=> string(7) “gateway” [2]=> string(6) “themes” [3]=> string(8) “language” } } [“main”]=> array(43) { [“web_title”]=> string(7) “NIP SMS” [“email_service”]=> string(11) “sales@it.na” [“email_footer”]=> string(17) “Powered by HostIT” [“main_website_name”]=> string(7) “NIP SMS” [“main_website_url”]=> string(13) “sms.nip.it.na” [“gateway_number”]=> string(5) “40400” [“gateway_timezone”]=> string(5) “+0200” [“default_rate”]=> string(1) “0” [“gateway_module”]=> string(3) “dev” [“themes_module”]=> string(7) “default” [“language_module”]=> string(5) “en_US” [“sms_max_count”]=> int(3) [“default_credit”]=> string(1) “0” [“enable_register”]=> string(1) “0” [“enable_forgot”]=> string(1) “1” [“allow_custom_sender”]=> string(1) “0” [“allow_custom_footer”]=> string(1) “0” [“default_user_status”]=> string(1) “3” [“enable_logo”]=> string(1) “1” [“logo_url”]=> string(35) “plugin/themes/common/images/nip.png” [“logo_replace_title”]=> string(1) “1” [“layout_footer”]=> string(9) “HostIT ©” [“buy_credit_page_title”]=> string(10) “Buy credit” [“buy_credit_page_content”]=> string(57) “Go to main configuration or manage site to edit this page” [“information_title”]=> string(14) “NIP SMS System” [“information_content”]=> string(537) "

NIP SMS Portal

If you have any problems with this portal please go to the Helpdesk and log a call.

Need to speak to someone please contact +264 811 234649 or +264 61 234649

Our office are open from 07:00 to 16:00 WAT Monday - Friday

Neet to contact by e-mail sales at it.na
" [“username_length”]=> string(2) “30” [“plus_sign_remove”]=> string(1) “0” [“plus_sign_add”]=> string(1) “0” [“enable_credit_unicode”]=> string(1) “0” [“brute_force_detection”]=> string(1) “1” [“keyword_separator”]=> string(0) “” [“credit_lowest_limit”]=> string(1) “0” [“sms_limit_per_hour”]=> string(1) “0” [“default_replace_zero”]=> string(0) “” [“default_parent”]=> string(1) “0” [“default_acl”]=> string(1) “0” [“disable_login_as”]=> string(1) “0” [“enhance_privacy_subuser”]=> string(1) “0” [“per_sms_length”]=> int(153) [“per_sms_length_unicode”]=> int(67) [“max_sms_length”]=> int(459) [“max_sms_length_unicode”]=> int(201) } [“datetime”]=> array(2) { [“format”]=> string(11) “Y-m-d H:i:s” [“now_stamp”]=> string(14) “20160722091647” } [“reserved_keywords”]=> array(1) { [0]=> string(2) “BC” } [“sendsmsd_limit”]=> int(1000) } ["_SERVER"]=> array(33) { [“USER”]=> string(5) “nginx” [“HOME”]=> string(16) “/var/cache/nginx” [“HTTP_CONNECTION”]=> string(10) “keep-alive” [“HTTP_COOKIE”]=> string(85) “PHPSESSID=i4d9evmgpa0gtht9tnoatvdmp7; main_config_last_tab=%23tabs-site-configuration” [“HTTP_REFERER”]=> string(65) “http://sms.nip.it.na/index.php?app=main&inc=core_auth&route=login” [“HTTP_ACCEPT_ENCODING”]=> string(13) “gzip, deflate” [“HTTP_ACCEPT_LANGUAGE”]=> string(2) “en” [“HTTP_ACCEPT”]=> string(63) “text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8” [“HTTP_USER_AGENT”]=> string(72) “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0” [“HTTP_HOST”]=> string(13) “sms.nip.it.na” [“REDIRECT_STATUS”]=> string(3) “200” [“SERVER_NAME”]=> string(13) “sms.nip.it.na” [“SERVER_PORT”]=> string(2) “80” [“SERVER_ADDR”]=> string(8) “10.2.4.7” [“REMOTE_PORT”]=> string(5) “53458” [“REMOTE_ADDR”]=> string(13) “41.182.84.185” [“SERVER_SOFTWARE”]=> string(12) “nginx/1.10.1” [“GATEWAY_INTERFACE”]=> string(7) “CGI/1.1” [“REQUEST_SCHEME”]=> string(4) “http” [“SERVER_PROTOCOL”]=> string(8) “HTTP/1.1” [“DOCUMENT_ROOT”]=> string(9) “/home/sms” [“DOCUMENT_URI”]=> string(10) “/index.php” [“REQUEST_URI”]=> string(45) “/index.php?app=main&inc=core_auth&route=login” [“SCRIPT_NAME”]=> string(10) “/index.php” [“CONTENT_LENGTH”]=> string(0) “” [“CONTENT_TYPE”]=> string(0) “” [“REQUEST_METHOD”]=> string(3) “GET” [“QUERY_STRING”]=> string(34) “app=main&inc=core_auth&route=login” [“SCRIPT_FILENAME”]=> string(19) “/home/sms/index.php” [“FCGI_ROLE”]=> string(9) “RESPONDER” [“PHP_SELF”]=> string(10) “/index.php” [“REQUEST_TIME_FLOAT”]=> float(1469179007.4371) [“REQUEST_TIME”]=> int(1469179007) } [“version”]=> array(3) { [0]=> string(1) “7” [1]=> string(1) “0” [2]=> string(1) “9” } [“c_script_filename”]=> string(18) “/home/sms/init.php” [“c_php_self”]=> string(10) “/index.php” [“c_http_host”]=> string(13) “sms.nip.it.na” [“val”]=> string(1) “0” [“key”]=> string(23) “enhance_privacy_subuser” [“dba_object”]=> object(DB_mysqli)#44 (28) { [“phptype”]=> string(6) “mysqli” [“dbsyntax”]=> string(6) “mysqli” [“features”]=> array(7) { [“limit”]=> string(5) “alter” [“new_link”]=> bool(false) [“numrows”]=> bool(true) [“pconnect”]=> bool(false) [“prepare”]=> bool(false) [“ssl”]=> bool(true) [“transactions”]=> bool(true) } [“errorcode_map”]=> array(26) { [1004]=> int(-15) [1005]=> int(-15) [1006]=> int(-15) [1007]=> int(-5) [1008]=> int(-17) [1022]=> int(-5) [1044]=> int(-26) [1046]=> int(-14) [1048]=> int(-3) [1049]=> int(-27) [1050]=> int(-5) [1051]=> int(-18) [1054]=> int(-19) [1061]=> int(-5) [1062]=> int(-5) [1064]=> int(-2) [1091]=> int(-4) [1100]=> int(-21) [1136]=> int(-22) [1142]=> int(-26) [1146]=> int(-18) [1216]=> int(-3) [1217]=> int(-3) [1356]=> int(-13) [1451]=> int(-3) [1452]=> int(-3) } [“connection”]=> object(mysqli)#152 (19) { [“affected_rows”]=> int(0) [“client_info”]=> string(79) “mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $” [“client_version”]=> int(50012) [“connect_errno”]=> int(0) [“connect_error”]=> NULL [“errno”]=> int(0) [“error”]=> string(0) “” [“error_list”]=> array(0) { } [“field_count”]=> int(1) [“host_info”]=> string(25) “Localhost via UNIX socket” [“info”]=> NULL [“insert_id”]=> int(0) [“server_info”]=> string(14) “5.5.47-MariaDB” [“server_version”]=> int(50547) [“stat”]=> string(137) “Uptime: 4649 Threads: 1 Questions: 290957 Slow queries: 0 Opens: 24 Flush tables: 2 Open tables: 50 Queries per second avg: 62.584” [“sqlstate”]=> string(5) “00000” [“protocol_version”]=> int(10) [“thread_id”]=> int(21364) [“warning_count”]=> int(0) } [“dsn”]=> array(9) { [“phptype”]=> string(6) “mysqli” [“dbsyntax”]=> string(6) “mysqli” [“username”]=> string(4) “root” [“password”]=> string(9) “nip435nam” [“protocol”]=> string(3) “tcp” [“hostspec”]=> string(9) “localhost” [“port”]=> string(4) “3306” [“socket”]=> bool(false) [“database”]=> string(5) “smsdb” } [“autocommit”]=> bool(true) [“transaction_opcount”]=> int(0) ["_db"]=> string(5) “smsdb” [“mysqli_flags”]=> array(11) { [1]=> string(8) “not_null” [2]=> string(11) “primary_key” [4]=> string(10) “unique_key” [8]=> string(12) “multiple_key” [16]=> string(4) “blob” [32]=> string(8) “unsigned” [64]=> string(8) “zerofill” [512]=> string(14) “auto_increment” [1024]=> string(9) “timestamp” [2048]=> string(3) “set” [32768]=> string(8) “group_by” } [“mysqli_types”]=> array(25) { [0]=> string(7) “decimal” [1]=> string(7) “tinyint” [2]=> string(3) “int” [3]=> string(3) “int” [4]=> string(5) “float” [5]=> string(6) “double” [7]=> string(9) “timestamp” [8]=> string(6) “bigint” [9]=> string(9) “mediumint” [10]=> string(4) “date” [11]=> string(4) “time” [12]=> string(8) “datetime” [13]=> string(4) “year” [14]=> string(4) “date” [247]=> string(4) “enum” [248]=> string(3) “set” [249]=> string(8) “tinyblob” [250]=> string(10) “mediumblob” [251]=> string(8) “longblob” [252]=> string(4) “blob” [253]=> string(7) “varchar” [254]=> string(4) “char” [255]=> string(8) “geometry” [16]=> string(3) “bit” [246]=> string(7) “decimal” } [“fetchmode”]=> int(1) [“fetchmode_object_class”]=> string(8) “stdClass” [“was_connected”]=> NULL [“last_query”]=> string(82) “SELECT language_module FROM playsms_tblUser WHERE flag_deleted=‘0’ AND username=’’” [“options”]=> array(8) { [“result_buffering”]=> int(500) [“persistent”]=> string(4) “true” [“ssl”]=> bool(false) [“debug”]=> int(0) [“seqname_format”]=> string(6) “%s_seq” [“autofree”]=> bool(false) [“portability”]=> int(0) [“optimize”]=> string(11) “performance” } [“last_parameters”]=> array(0) { } [“prepare_tokens”]=> array(0) { } [“prepare_types”]=> array(0) { } [“prepared_queries”]=> array(0) { } ["_last_query_manip"]=> bool(false) ["_next_query_manip"]=> bool(false) ["_debug"]=> bool(false) ["_default_error_mode"]=> NULL ["_default_error_options"]=> NULL ["_default_error_handler"]=> string(0) “” ["_error_class"]=> string(8) “DB_Error” ["_expected_errors"]=> array(0) { } } [“result”]=> array(1) { [“core”]=> array(1) { [“main_config”]=> array(39) { [“web_title”]=> string(7) “NIP SMS” [“email_service”]=> string(11) “sales@it.na” [“email_footer”]=> string(17) “Powered by HostIT” [“main_website_name”]=> string(7) “NIP SMS” [“main_website_url”]=> string(13) “sms.nip.it.na” [“gateway_number”]=> string(5) “40400” [“gateway_timezone”]=> string(5) “+0200” [“default_rate”]=> string(1) “0” [“gateway_module”]=> string(3) “dev” [“themes_module”]=> string(7) “default” [“language_module”]=> string(5) “en_US” [“sms_max_count”]=> string(1) “3” [“default_credit”]=> string(1) “0” [“enable_register”]=> string(1) “0” [“enable_forgot”]=> string(1) “1” [“allow_custom_sender”]=> string(1) “0” [“allow_custom_footer”]=> string(1) “0” [“default_user_status”]=> string(1) “3” [“enable_logo”]=> string(1) “1” [“logo_url”]=> string(35) “plugin/themes/common/images/nip.png” [“logo_replace_title”]=> string(1) “1” [“layout_footer”]=> string(9) “HostIT ©” [“buy_credit_page_title”]=> string(10) “Buy credit” [“buy_credit_page_content”]=> string(57) “Go to main configuration or manage site to edit this page” [“information_title”]=> string(14) “NIP SMS System” [“information_content”]=> string(537) "


(Anton Raharja) #12

Looks like logged in

Anton


(Steven Delport) #13

That is what I thought but it comes back with the login screen.
I will stay on it till I find out.


(Anton Raharja) #14

Try checking the log, look for unable to setup session ... message in log

paste here

I think its still related to session issue, probably the way your PHP handles $_SESSION, or maybe PHP7

anton


(Steven Delport) #15

Seems like a common error.
client closed connection while waiting for request.
Another strange thing is that when I put playsms debug to 3 it does not create any log files.


(Steven Delport) #16

Solved playsms does work with NGINX and php7 100%
All the problems I had was related to session thanks Anton for pointing me in the right direction.