SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict tedleonard's Avatar
    Join Date
    Jun 2000
    Location
    Dark side of the moon
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow Help with syntax error

    Hello,
    I am trying to set up a canned script, and in trying to get it to work I've come across a syntax error I don't really understand. I ran the following command via ssh on my webserver:

    Code:
    /usr/bin/php -c /home/path/to/mailPipe.php
    and here is the response I get:

    Code:
    PHP:  syntax error, unexpected '(' in /home/path/to/mailPipe.php on line 4
    here is the php code

    PHP Code:
    ;!/usr/bin/php -q
    <?php

    set_time_limit
    (600);
    ini_set('max_execution_time',600);
    require_once(
    'mailReader.php');
    $save_directory __DIR__
    $db_host 'localhost';$db_un '***';$db_pass '***';$db_name '***';$pdo = new PDO("mysql:host=$db_host;dbname=$db_name;charset=utf8",$db_un,$db_pass);

    $allowed_senders = Array('email1@email.com''email2@email.com''email3@email.com''email4@email.com''email5@email.com''email6@email.com''email7@email.com''email8@email.com''email9@email.com');
    $mr = new mailReader($save_directory,$allowed_senders,$pdo);
    $mr->save_msg_to_db TRUE;
    $mr->send_email FALSE;
    $mr->readEmail();?>
    not sure what could be wrong with that, can someone help? Thank you!!
    New Jerseyans: Beat your traffic ticket!
    http://www.njtrafficfines.com

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2006
    Location
    Nantwich, Cheshire
    Posts
    408
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Is it pointing to a syntax error in the mailreader.php file that you include? Leaving out whitespace that conceivably might be line 4?
    http://www.firenza.net - my homage to a car from the 1970s

  3. #3
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,122
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    I don't think you want to use -c .... that refers to pointing to a config file (think php.ini), not your file.

    If you want to look for syntax errors, use -l
    http://www.php.net/manual/en/feature...ne.options.php

    PHP Code:
    /usr/bin/php -/home/path/to/mailPipe.php 
    If you want to execute it
    PHP Code:
    /usr/bin/php /home/path/to/mailPipe.php 

  4. #4
    SitePoint Addict tedleonard's Avatar
    Join Date
    Jun 2000
    Location
    Dark side of the moon
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I was instructed by my webhost's techsupport to use -c but I agree I think they must have meant to use -l. Using -l both files checked out with no syntax errors. Not sure what is going on here. Thanks for your help!
    Dan
    New Jerseyans: Beat your traffic ticket!
    http://www.njtrafficfines.com


Bookmarks

Posting Permissions

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