PHP script doesn't stop after error

Juan Ramos

I am using CodeIgniter framework and After testing in XAMPP, a normal error like "Missing argument" the php script stops and it shows me the PHP Warning page, however in the hosting server(e.g. GoDaddy) the php script takes a while to stop and it shows me the 500 error page, consequently the server has a new Entry Process.

Any idea? Thanks!

   public function getAQByLocation($city) {
        $this->load->helper('url');
        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, "http://api.waqi.info/feed/$city/?
        token=" . $this->AQ_API_KEY);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        $result = curl_exec($ch);

        if (curl_errno($ch)) {
            echo 'Error:' . curl_error($ch);
        }
        curl_close ($ch);

        echo $result;
    }

This is the code, to simulate that error i just omitted the parameter $city, e.g. xxx.com/Home/getAQByLocation

Juan Ramos

the solution was to set the value

$config['log_threshold'] = 1;

in the config.php. Thank you every one!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Script doesn't stop

SLURM batch script doesn't execute Python script, returns no error message and doesn't stop running

Action Script 3.0 timer doesn't stop

Jenkins doesn't stop after Git clone

ISupportIncrementalLoading doesn't stop after navigating away

Error in fetch request doesn't stop function

Notifier doesn't stop parallel loops on error

Bash script that starts python script doesn't stop itself

Script after opening jar file doesn't execute code after and not throwing any error

for loop doesn't after looping throw the script

Google App Script debugger doesn't stop reliably at breakpoint

Bash script with `set -e` doesn't stop on `... && ...` command

Script execution doesn't stop when loop condition is false

Regex doesn't stop evaluating after matching with first rule with OR operator

Program doesn't stop after reading from pipe

FusedLocationClient doesn't stop searching for gps after request

Okhttp : Asynchronous request doesn't stop immediately after onResponse

Java sound doesn't work after I stop it

My recursive method doesn't stop after it reaches the end of the method

object doesn't stop on position after jump javascript

while loop doesn't stop looping even after variable change

php mysql, login script. My error message doesn't show

cURL - prompt script works while same request with curl-php doesn't (Internal server error 500)

PHP: if file doesn't exist then exit script

Php script doesn't capture input fields

PHP AGI script doesn't insert into database

php editing script doesn't work properly

Php & MySQL login script doesn't react

shell script stop error