slinky

Well-Known Member
Jul 26, 2007
78
2
58
Here's a good one and hopefully someone can help me fix the solution I received. My cpanel doesn't work properly in entering a pipe - if you want to add a new pipe on some servers, you need to do the following in shell:

Modify /etc/valias/yourdomain.com so it is like this:

[email protected]: "|/usr/bin/php -q
/home/youraccount/public_html/support/cli/index.php"

This is because cpanel adds the /home/youraccount/ to the beginning of the entry for piping. This is annoying but it is what it is. Now that I know the problem of cpanel adding the bad paths, how can I modify this file? I couldn't navigate it even though I have shell access and ability to use vi. This is a very useful piece of info but I can't make use of it for my second account! LOL.
 

d_t

Well-Known Member
Sep 20, 2003
243
2
168
Bucharest
Try to set the pipe this way:

Code:
[email protected]: "| /home/youraccount/public_html/support/cli/index.php"
and make sure you php file is executable (you can set x attribute from shell or FTP) and start with
Code:
#!/usr/bin/php -q
<?
 

slinky

Well-Known Member
Jul 26, 2007
78
2
58
I think I found it. Need to login as root and then go back to the server root to find the etc directory.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
11
313
Houston, TX
cPanel Access Level
Root Administrator
Here's a good one and hopefully someone can help me fix the solution I received. My cpanel doesn't work properly in entering a pipe - if you want to add a new pipe on some servers, you need to do the following in shell:

Modify /etc/valias/yourdomain.com so it is like this:

[email protected]: "|/usr/bin/php -q
/home/youraccount/public_html/support/cli/index.php"

This is because cpanel adds the /home/youraccount/ to the beginning of the entry for piping. This is annoying but it is what it is. Now that I know the problem of cpanel adding the bad paths, how can I modify this file? I couldn't navigate it even though I have shell access and ability to use vi. This is a very useful piece of info but I can't make use of it for my second account! LOL.
I recommend just inserting public_html/support/cli/index.php as the pipe and performing the minor modifications to the PHP script to make it a shell script.

This means adding this line above the first line of your file:

Code:
#!/usr/bin/php -q
And also changing the file permissions to have executable permissions.

It's much easier than constantly modifying stuff via SSH :).