Location of PHP script to run external command

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Location of PHP script to run external command

Post by anjanesh »

Hi

I need to create a domain using Plesk API - calling the command line ./domain.sh in PHP.

exec ? If so where ? Which location ? I got root access to a dedication server using Fedora Core Linux.

Thanks
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Do you extract a directory containing that file at some point?

Anyway...

Code: Select all

locate domain.sh #or .....
find /* -name 'domain.sh' -print
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

domain.sh is in /usr/local/psa/bin
I have a one-line php code

Code: Select all

exec('./domain.sh $args');
Where do I place this php code and how do I run this ? Its not necessary that I got to enter a url - entering the command in Putty is fine.
In the latter case would the 1st line be something like #!/usr/bin/php ?
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

Hello,
There is default plesk document root. Generally it is

Code: Select all

/home/httpd/vhosts/default-host/<file.php>
Access this php file on the web-browser on plesk port.
I dont remember the entire path but Im sure default is in /home/httpd/vhost.
Inside this you find configuration files of plesk
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Access this php file on the web-browser on plesk port.
Ah...Thank you very much dude81 - that was very helpful info.
Post Reply