lundi 5 octobre 2015

Troubleshoot Codeigniter CLI stopped

I have been using the CLI interface to send out cron jobs from my codeigniter page. It worked fine until I updated Wordpress yesterday. I do not know how this effected Codeigniter but that is when the trouble started. I also installed cURL at about the same time. I am not sure if that could have made a difference.

SYMPTOMS: None of my codeigniter CLI scripts work. I have two scripts that send out email reminders, and another that synchronizes my database and none function.

ERRORS: I had some errors come up when I tried to run my scripts such as: Use of undefined constant DIR - assumed 'DIR'

This was never a problem before. But for now I change that to dirname(FILE) and that seemed to help. At least that error stopped.

Next another error notice appeared regarding code in my scripts that I was not getting before: "Can't use method return value in write context in . . ."

This error was in reference to this line of code:

if (!empty($this->get_available_hours($date, $provider_id))) {

I modified this to

$availabehours=$this->get_available_hours($date, $provider_id);
if (!empty($availabehours)) {

And the error stopped. But the script usually sends out email regarding availability and no email is sent.

Now I have no errors. I run the scripts and I get no results. If I purposefully mess with the code and do things wrong, I get the appropriate error messages. So, at some level it is reading the file.

I tried just running a simple "hello world file" as discribed here http://ift.tt/Y5erWB And nothing was returned.

I tried a simple email script that would send out an email without accessing my database and it did not send anything to me.

It appeares to me like something has caused my code to be interpreted in an older version of php. So I looked at the version currently running: PHP 5.2.17 (cli) (built: Feb 23 2012 10:42:34) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies

This looks up to date.

MY QUESTION: What tests can I run to find out what is blocking things with my CLI? Any tips would be appreciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire