Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2011
    Posts
    417
    Thanks
    18
    Thanked 26 Times in 26 Posts

    I think CodeIgniter is drunked..

    SO I have a simple file that I setup to define basic data which can vary from the site domain/name, to log constants. For some reason, if I don't include the file everything breaks due to undefined constants (which is correct). However, if I include the file, my cron job is crapping out and saying the constant is already defined. The site has no issue and the file is only included once.

    What I've tried:
    • Renaming the file and require statement to see if it was somewhere else and hope it would crap out saying the file could not be found, but no luck.
    • Putting die(var_export(debug_backtrace(), true)); in the config file, only reports the one time it's included when it should be.
    • Placing if(defined("NAME")) return; in the top of the file (one of the constants in it). It just stops including and says the rest of the constants are missing.
    • Searching the entire directory for another occurrence of NAME being defined, none for this project


    This issue is driving me insane. I checked the file the cron job uses and it doesn't include anything, it's just a class. The way it used to be was a config.php was in the main www folder and was included by the front index.php file. For some reason, the cron job doesn't work properly and the index.php isn't executed, even though the code all runs.

    The main core of the issue centralizes around cron jobs with CodeIgniter not running, which is stupid. The cron works if I run it via SSH, however the cron task itself doesn't seem to work correctly. Additionally, parameters are not passed via cron jobs, only by SSH. I don't know if this is CodeIgniter's fault or my hosting company, but I'd prefer to get a few other opinions before bugging my hosting provider about it again.
    Last edited by Dubz; 06-27-2014 at 04:15 AM.
    If I've helped you out, show your appreciation by clicking the "Thanks" link as well as a link below!

    AdFly
    Facebook | Twitter
    Google | YouTube

  • #2
    Regular Coder
    Join Date
    Sep 2011
    Posts
    417
    Thanks
    18
    Thanked 26 Times in 26 Posts
    Well it turns out I was the drunk one, again..

    I used to host the site on a beta.* subdomain. When I flopped everything around, so the original became beta and the beta became original, I swapped everything (folders and database) except the cron jobs, they were still pointed at the beta.* folder. Well now that I have everything working how it should be and spent the past about week give or take debugging that issue (on and off), I'm glad it's working now.
    If I've helped you out, show your appreciation by clicking the "Thanks" link as well as a link below!

    AdFly
    Facebook | Twitter
    Google | YouTube

  • #3
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,325
    Thanks
    60
    Thanked 525 Times in 512 Posts
    Blog Entries
    4
    hehehe hic
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •