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.

Problem with exec()

Discussion in 'General Discussion' started by Phree, Jan 17, 2006.

  1. Phree

    Phree Member

    Joined:
    Nov 17, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    South Coast of England
    Hi,

    I have a small site where users can upload images/movies etc via their mobile phones. With images, there is a facility to edit them using imagemagick. When I try and test this, I get:

    Warning: exec() has been disabled for security reasons in /home/../../../imageedit.php on line 128

    I realise that the exec() function has been disabled but my hosts told me I could create a new php.ini file and put it in that folder where I run my imageedit.php. I had no idea how to achive this and the hosts tell me it's above their usual support to help me with a request of this kind, so I started trawling the net and found:

    So I figured, I could just put a small php.ini file in that folder that had the command I needed and anything else would be taken from the main php.ini file on the server.

    So I created a small php.ini and this is what it had:
    PHP:
    php ]
    enable_functions exec
    I then tried again, but it still failed with the same error. I tried putting the php.ini file in my public_html, my main mms site folder, and the delete folder but still nothing would work. Am I doing something very wrong here?

    I *think* I read somewhere that after making the changes, the server needs rebooting? If so, I'm all out of luck because my hosts won't do that as it's shared.

    I hope someone can help - thanks to anyone who takes the time to read this :)
     
  2. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The php.ini file doesn't need
    PHP:
     just the enable_functions exec and should be owned by the account user.

    No reboot required to make it work.

    Does the directory in question contain a .htaccess file?
     
  3. Phree

    Phree Member

    Joined:
    Nov 17, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    South Coast of England
    Hi Sawbuck, thanks very much for the response.

    So my entire php.ini file should contain:
    PHP:
    enable_functions exec
    And nothing else?

    The directory does contain a .htaccess file - does this matter?;
    When you say the file should be owned by the account user, how do I know if it's me that owns it? Sorry for the (possibly) stupid question!

    Thanks again :)
     
  4. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Yes to the php.ini.

    No stupid questions. Assume you are using an ftp program to upload your files then it should have the ability to tell you what the permissions/ownership of a given file are. Generally files uploaded to an account take on the ownership of the account user.

    Depending on what your host has setup the .htaccess file can conflict with the php.ini. For testing purposes you can simply rename the .htaccess to something else.
     
  5. Phree

    Phree Member

    Joined:
    Nov 17, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    South Coast of England
    Sawbuck,

    thanks once again.

    I do indeed use an ftp program to upload my files so I will take a look and see if I can find what you say.

    I'll also do as you say with the .htaccess file.

    I'm stuck at work on the dreaded night shift tonight, but I'll race home in the morning and try out all you have said and I'll post back on here after to let you know the outcome.

    Thanks again!
     
  6. Phree

    Phree Member

    Joined:
    Nov 17, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    South Coast of England
    Hi,

    just to let you know that I tried all the above - and it didn't work. I've raised an issue with my hosts asking them why they told me I could create and use my own php.ini file to combat the exec command being disabled and yet when I try it, it doesn't work. I'll let you know what they say :rolleyes:
     
Loading...

Share This Page