Why localhost react different compare to server in PHP programing - php

My question is look like duplicate but it is not.
Error like
Notice: Constant BASE_URL already defined in
Notice: Undefined variable: nomobile in
Notice: Constant imagesize already defined in
Notice: A session had already been started - ignoring session_start() in
But there is no problem in server. and i am using
PHP version: 5.6.30 both side.

This is error disable in server so server cannot show error.
For more information

Related

`CakeResponse` referencing undefined variables in `compact()` call triggers errors/notices

I’m updating my first CakePHP application on a web server, but pages show errors which are at the end of this post. I can’t find the file(s) which have not uploded correctly. Thanks for help.
CakePHP version : 2.9
Error messages :
Notice (8): compact(): Undefined variable: etagMatches [CORE/Cake/Network/CakeResponse.php, line 1171]*
Notice (8): compact() [function.compact]: Undefined variable: timeMatches [CORE/Cake/Network/CakeResponse.php, line 1171]*
Notice (8): compact() [function.compact]: Undefined variable: subject [CORE/Cake/Utility/ObjectCollection.php, line 128]*
As of PHP 7.3 compact() will trigger an error when referencing undefined variables.
This has been fixed in CakePHP 2.10.13, either upgrade your application (preferred), or downgrade your PHP version.
https://github.com/cakephp/cakephp/pull/12487

Nusoap Undefined index in nusoap.php on line

I'm trying to call my WS from my device, but I get this error:
PHP Notice: Undefined index: in C:\wamp64\www\gcm\lib\nusoap.php on line 6637
But, when I test the WS from SOAPUI I get the correct result:
Any solution?
as per your statement, that is not an error. it is just a notice, you can ignore that.
disable php errors by error_reporting(0) and check

php error MYSQLI_OPT_CONNECT_TIMEOUT using meekrodb

I am building a PHP website using MeekroDB and PHPMailer.
I don't know why, but today I got this PHP error that is only on my desktop.
On my laptop everything works fine.
I've tried to reinstall MySQL and delete all files and copies from my laptop.
The error is:
Notice: Use of undefined constant MYSQLI_OPT_CONNECT_TIMEOUT - assumed 'MYSQLI_OPT_CONNECT_TIMEOUT' in /var/www/html/GIT/pressofficer/public/conf/configurations.php on line 6
Notice: Use of undefined constant MYSQLI_OPT_CONNECT_TIMEOUT - assumed 'MYSQLI_OPT_CONNECT_TIMEOUT' in /var/www/html/GIT/pressofficer/public/libs/meekrodb.2.3.class.php on line 49
Fatal error: Class 'mysqli' not found in /var/www/html/GIT/pressofficer/public/libs/meekrodb.2.3.class.php on line 169
Sorry for the unnecessary post but I installed mysqli again and it started working.
Note that is mysqli not only mysql.
I am don't know much about databases that's why I was very confused.
Thanks anyway people.

Manual php script execution works while execution via debian fails

I have a problem with running the script using scheduled cron jobs. The thing is that when I run the php script using the browser it is executed without any problems/failures etc.
But when I try to run it using crons or SSH I get weird errors:
Notice: Undefined index: HTTP_USER_AGENT in /home/loves/public_html/parser/shop_parse_class.php on line 125
PHP Notice: Undefined offset: 0 in /home/loves/public_html/parser/shop_parse_class.php on line 481
PHP Notice: Undefined offset: 1 in /home/loves/public_html/parser/shop_parse_class.php on line 482
PHP Notice: Undefined variable: cat in /home/loves/public_html/parser/shop_parse_class.php on line 538
As you can see from the errors it shows that, for example the option HTTP_USER_AGENT doesn't exist for the CURL, which is kinda weird. Maybe the problem is with the environment variables, however I have poor knowledge of linux system.
You should add the -A or --user-agent parameter to the cURL call.
You can set anything you want as user agent this way.
HTTP_USER_AGENT is a information returned by the browser, if you are running like a script, you can't use this array. Is that reason the array is empty (the message tells that the index you trying to use in array don't exists)

"Use of undefined constant CURLOPT_PROTOCOLS and CURLPROTO_HTTP" but it works?

Hi on our dev environment we have show all errors, warnings and notices. I'm getting this:
Notice: Use of undefined constant CURLOPT_PROTOCOLS - assumed 'CURLOPT_PROTOCOLS' in C:\notion\implementation\development\asterix\library\ExternalLibs\panda.php on line 69
Notice: Use of undefined constant CURLPROTO_HTTP - assumed 'CURLPROTO_HTTP' in C:\notion\implementation\development\asterix\library\ExternalLibs\panda.php on line 69
The code on line 69:
curl_setopt($curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP);
But the CURL code works, it goes off to the other server and retrieves whats necessary. What do these notices mean?
Thanks very much.
This seemed to be a bug in PHP 5.2.9: #48390
According to the documentation, the option "CURLOPT_PROTOCOLS" is available as of cURL 7.19.4, but PHP is throwing a notice: "Use of undefined constant CURLOPT_PROTOCOLS - assumed 'CURLOPT_PROTOCOLS'"
Also all the "CURLPROTO_*" constants are not available:
Use of undefined constant CURLPROTO_HTTPS - assumed 'CURLPROTO_HTTPS'
I don't know what this setting does exactly, but I would assume in your case, the setting is not applied at all, because curl can't interpret the string "CURLPROTO_HTTP". If it works either way, it may be safer to comment it out, because with the next upgrade, the constants are likely to be there.
This issue can occur either curl extension is not enabled or available.
Try to install curl extension from [how to download curl on ubuntu][1]
I faced same issue when I was calling a script with php-cli but the extension was not enabled for cli mode.

Categories