www.webdeveloper.com
Results 1 to 5 of 5

Thread: How to convert a php webpage into a script

  1. #1
    Join Date
    Dec 2013
    Location
    Melbourne, Australia
    Posts
    25

    How to convert a php webpage into a script

    I have a page which when I access, checks the local mail server for new emails, and if found, will extract the attachment and insert the contents into a database.

    This process works fine however, I want to automate it.

    I have setup a cron job to automate it but I can't get it to work and I don't know where to start looking?

    This is what I have scheduled in cron:

    Code:
    /usr/bin/php /home/public_html/process-emails.php
    All I get back from this is the following:

    Status: 500 Internal Server Error
    X-Powered-By: PHP/5.2.14
    Content-type: text/html
    I know that it is executing the file because if I change a few things in the file I can generate a different error message... i guess, I just want to know where to go to look for more detailed error logs.

    Where can I start? I can't even locate the log file that might give me some more information?

    The cron log provides absolutely nothing?

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,912
    Try putting this is a script and running it from the command line (the CLI config may be different from the web config):
    PHP Code:
    <?php
    echo ini_get('error_log');
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Dec 2013
    Location
    Melbourne, Australia
    Posts
    25
    I did that but all it did was output the ext "error_log"

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,912
    You could just try setting it at the top of your script:
    PHP Code:
    <?php
    ini_set
    ('error_log''/path/to/where/you/want/it/php_errors.log');
    error_reporting(E_ALL);
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Dec 2013
    Location
    Melbourne, Australia
    Posts
    25
    Legend! Perfect!

    Got the errors displaying and found the problem!

    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles