Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 14 of 14
  1. #1
    Member celliott's Avatar
    Join Date
    Jan 2006
    Location
    United Kingdom
    Posts
    460

    Angry PHP Email Piping not working with cPanel 11

    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. #2
    Member
    Join Date
    Feb 2006
    Posts
    12

    Default

    We also have this problem, any help would be appriciated!

  3. #3
    Member
    Join Date
    Jun 2006
    Posts
    212

    Default

    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.
    Alex Villegas

  4. #4
    Member
    Join Date
    Feb 2006
    Posts
    12

    Default

    Done Thanks Alex

  5. #5
    Member
    Join Date
    Jun 2006
    Posts
    212

    Default

    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.
    Alex Villegas

  6. #6
    Registered User
    Join Date
    Jul 2005
    Posts
    2

    Default

    Is there ant way of manually adding the pipe command to a config file, rather than using the cPanel UI?

  7. #7
    Member
    Join Date
    Dec 2003
    Location
    France
    Posts
    300
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by klutsh View Post
    Is there ant way of manually adding the pipe command to a config file, rather than using the cPanel UI?
    Yes : edit the file /etc/valiases/yourdomain.com
    Marie - Co-Owner
    Need Further Assistance ? Here you go !
    English, french and spanish support

  8. #8
    Registered User
    Join Date
    Jul 2005
    Posts
    2

    Default

    Quote Originally Posted by yapluka View Post
    Yes : edit the file /etc/valiases/yourdomain.com
    Thanks, that works great.

  9. #9
    Member
    Join Date
    Nov 2006
    Posts
    6

    Default

    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. #10
    Member
    Join Date
    Feb 2006
    Posts
    12

    Default

    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. #11
    Member
    Join Date
    Nov 2006
    Posts
    6

    Default

    Quote Originally Posted by pcsmart24 View Post
    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
    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. #12
    Member
    Join Date
    Nov 2004
    Posts
    16

    Default

    Quote Originally Posted by yapluka View Post
    Yes : edit the file /etc/valiases/yourdomain.com
    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. #13
    Member
    Join Date
    Sep 2005
    Posts
    38

    Default

    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 Code:
    #!/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. #14
    Member
    Join Date
    Nov 2007
    Posts
    6

    Default

    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

Similar Threads & Tags
Similar threads

  1. email piping stop working after upgrade
    By sergiog in forum E-mail Discussions
    Replies: 0
    Last Post: 08-29-2011, 03:32 PM
  2. Email piping to a php script fopen disabled
    By broncha in forum cPanel Developers
    Replies: 5
    Last Post: 08-28-2011, 06:51 AM
  3. Piping email with cPanel 11 x3
    By StarShards in forum E-mail Discussions
    Replies: 1
    Last Post: 10-30-2010, 09:24 PM
  4. Email Piping to PHP with CATCH ALL
    By zeeshanhashmi in forum cPanel Developers
    Replies: 11
    Last Post: 06-10-2010, 07:58 AM
  5. Replies: 1
    Last Post: 06-20-2003, 02:57 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube