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 Script

Discussion in 'General Discussion' started by AlienZ, Jun 29, 2005.

  1. AlienZ

    AlienZ Registered

    Joined:
    Jun 29, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I cant find much support for a php programmer who wants to add a simple script to cpanel or whm so I thought I would post here after scouring the forums for 2 hours...

    I have a php script that runs fine on its own. I moved it to /usr/local/cpanel/3rdparty/newfolder and when I got to access it via the web at https://www.mydomain.com:2083/3rdparty/newfolder/index.php

    it says "No input file specified. "

    I have tried looking for example scripts to learn from, but cant find any. I cant find any help on this. I added the line "#!/usr/local/cpanel/3rdparty/bin/php" at the beginning of the script, this still didnt help...

    am I not doing something I should be?

    does anyone know anywhere i can get some tips or information on writing scripts for cpanel or whm?

    thanks...
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    I assume scripts running from /usr/local/cpanel/3rdparty shouldn't need anything special doing to them to work with cPanel - I doubt that phpMyAdmin is cPanel specific, for example.

    Therefore its more likely that there is an issue with the script itself - are you trying to include any files? Trying to load any files? If so, check that the paths are correct and check the permissions of the script itself and those of anything you are trying to include or open.

    Test with a very very basic script and work up from there. If something like:

    PHP:
    <?php

    echo "Something is happening!";

    ?>
    doesn't work, and you've tried with and without "#!/usr/local/cpanel/3rdparty/bin/php" and "#!/usr/local/bin/php", then hunt around for the relevant error_log (should be in the same dir as the executing script if you're lucky) and try turning on error reporting.
     
  3. AlienZ

    AlienZ Registered

    Joined:
    Jun 29, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    hmm

    I did some testing and found out that it doesnt actually publicly host any of the 3rdparty directories i can find there..

    I tried even adding basic html pages and i cannot access them from outside. Basically i can access any made up url and if its an html page it will give me a blank html page, if its a php page it will give me the above error and if its a directory, it will tell me it cant find it or give its contents...

    Basically all I want to do is be able to run this script from cpanel preferably but more importantly as the user or as root as opposed to apache or nobody..
     
  4. B12Org

    B12Org Well-Known Member

    Joined:
    Jul 15, 2003
    Messages:
    692
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Seattle Washington
    cPanel Access Level:
    Root Administrator
    try adding an alias to the httpd.conf file
     
Loading...

Share This Page