The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Email Piping not working with cPanel 11

Discussion in 'E-mail Discussions' started by celliott, May 9, 2007.

  1. celliott

    celliott Well-Known Member

    Joined:
    Jan 2, 2006
    Messages:
    460
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    Hi,

    We use email piping for WHMCS on our server by setting up a forwarder on our support address to: php -q /home/usernme/public_html/clients/pipe/pipe.php

    Since updating to cPanel 11 the piped emails are all blank, no body information, no subject or from address.

    We are running CentOS 4.4 with the latest CURRENT build.

    Any suggestions?
     
  2. pcsmart24

    pcsmart24 Member

    Joined:
    Feb 15, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    We also have this problem, any help would be appriciated!
     
  3. AlexV.

    AlexV. Well-Known Member

    Joined:
    Jun 15, 2006
    Messages:
    212
    Likes Received:
    1
    Trophy Points:
    16
    Sorry to hear you are having issues with such feature.

    If you could please open a support ticket, we will look into it accordingly and discuss it with the QA and Developers as needed.
     
  4. pcsmart24

    pcsmart24 Member

    Joined:
    Feb 15, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Done :) Thanks Alex
     
  5. AlexV.

    AlexV. Well-Known Member

    Joined:
    Jun 15, 2006
    Messages:
    212
    Likes Received:
    1
    Trophy Points:
    16
    pcsmart24:

    We received your ticket and we are currently investigating as well as the correlation with WHMCS.

    We will update you as soon as more relevant information is available.
     
  6. klutsh

    klutsh Registered

    Joined:
    Jul 8, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Is there ant way of manually adding the pipe command to a config file, rather than using the cPanel UI?
     
  7. yapluka

    yapluka Well-Known Member

    Joined:
    Dec 24, 2003
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    France
    cPanel Access Level:
    Root Administrator
    Yes : edit the file /etc/valiases/yourdomain.com :)
     
  8. klutsh

    klutsh Registered

    Joined:
    Jul 8, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, that works great.
     
  9. tsgroup

    tsgroup Member

    Joined:
    Nov 28, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi all sorry to revive an old post but i have the exact same problem as mentioned in the first post, does anyone know if there is a way of sorting this out i have also scanned the whmcs forums and cant find anything about it there im using CPanel 11.

    Thanks
    Jay
     
  10. pcsmart24

    pcsmart24 Member

    Joined:
    Feb 15, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    This is the reply that WHMCS managed to sort out with cPanel.

    Hi,

    Well the actual issues, despite cPanel claiming they hadn't changed anything, was that a piping file is now required to have a hashbang line at the top of it - "#!/usr/local/bin/php", the readfile command we were using before to read in the email from the server has been blocked and fopen now has to be used, and the file permissions have to be set 755 or cPanel blocks the pipe from occuring. Although CHMOD to 755 has always been suggested, it was not required until cPanel 11.

    Regards,

    Matt

    Hope that helps

    Jason
     
  11. tsgroup

    tsgroup Member

    Joined:
    Nov 28, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi thanks for that i added the line to the pipe.php and now i get this error log in the pipe directory. I placed "#!/usr/local/bin/php" without quotes at very top of the file then i placed it under <php at top of file none of them made any difference.
    Code:
    [24-Jun-2007 19:44:32] PHP Parse error:  syntax error, unexpected T_IF in /home/USERNAME/public_html/order/pipe/pipe.php on line 34
    The email i get when i send to the address is as foillows
    This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients.
    This is a permanent error. The following address(es) failed:
    pipe to |/home/USERNAME/public_html/order/pipe/pipe.php
    generated by support @ xxxxx.com
    The following text was generated during the delivery attempt:
    ------ pipe to |/home/USERNAME/public_html/order/pipe/pipe.php
    generated by support @ xxxxx.com
    ------ PHP Warning: Unknown(): Unable to load dynamic library './php_curl.so' - ./php_curl.so: cannot open shared object file: No such file or directory in Unknown on line 0

    Any ideas or can you tell me exactly where you placed the HashBang also just so you dont need to ask line 34 is actually commented out text in the pipe.php file so shouldnt even effect it.
    thanks for your help
    Jay
     
  12. Dawzz

    Dawzz Member

    Joined:
    Nov 11, 2004
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    as stated and use :

    "|php -q /home/username/public_html/whmcsfolder/pipe/pipe.php"


    Then it will work. No need to try and add the shebang line :)
     
  13. maever

    maever Active Member

    Joined:
    Sep 26, 2005
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    I hate to be the one reviving such an old topic but I feel that my contribution is of great value since this is still a very common issue.

    for those of you who DO NOT have root access and therefor cannot access the /etc/valliasses directory.

    The correct steps are:
    -make sure that the hashbang is actually in the top of your script and IS NOT behind your <?php tag, it has to the FIRST line of your script.

    PHP:
    #!/usr/bin/php -q
    <?php 
    /** Code here **/
    ?>
    -Make sure that you save the file in UNIX format
    so YES there is a difference in how files are saved, programs like notepad will add a "windows newline" character which will appear as "^M" in linux.
    The script will then simply crash and not do anything + bounceback.
    To remove windows-enters please save your files with editplus or notepad++ (and be sure to set the file format to UNIX).
     
  14. cappac

    cappac Member

    Joined:
    Nov 30, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    As it has been stated already: on CPanel 11 use shebang

    #!/usr/local/bin/php -q

    in your php file.

    I got
    Error in argument 1, char 3: option not found
    while trying with
    #!/usr/bin/php -q
     
Loading...

Share This Page