venomous0x / WhatsAPI

Interface to WhatsApp Messenger
2.59k stars 2.14k forks source link

Fatal error: Maximum execution time of 30 seconds exceeded in /opt/lampp/htdocs/whatsapp/whatsapi/src/whatsprot.class.php on line 306 #1221

Open galaxyitcenter opened 6 years ago

galaxyitcenter commented 6 years ago

`<?php

require('vendor/autoload.php'); $username = "91932824xxxx"; $nickname = "Rahil"; $password = "lgP2OkhexINDxxxxxxxxxxxxxx"; // The one we got registering the number $debug = true;

// Create a instance of WhastPort. $w = new WhatsProt($username, $nickname, $debug);

//$w = new WhatsProt($username,$password, $nickname, $debug); $events = new MyEvents($w); $events->setEventsToListenFor($events->activeEvents); //You can also pass in your own array with a list of events to listen too instead.

//Now continue with your script. $w->connect(); $w->loginWithPassword($password);

$target = '91991336xxxx'; // The number of the person you are sending the message $message = 'Hi! :) this is a test message'; $w->sendMessage($target , $message);

Above is my code to send`

carlositos commented 6 years ago

Hi! I have the same issue. Does anyone fix this?

jesussales commented 6 years ago

That is a PHP configuration max_execution_time... you can change in php.ini or con init_set ('max_execution_time', seconds)

El 7 dic. 2017 14:58, "carlositos" notifications@github.com escribió:

Hi! I have the same issue. Does anyone fix this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/venomous0x/WhatsAPI/issues/1221#issuecomment-349974102, or mute the thread https://github.com/notifications/unsubscribe-auth/ACrGGN5Hc1TDF7rdiPDg8p6BwPjIRmJPks5s9-7ogaJpZM4PG61q .

alissonpelizaro commented 6 years ago

Just put the following sentence at the top of the your code:

set_time_limit(600);

It's changes the time-out to 10 minutes...