Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Exec() disabled

Started by Muut Archive 11 years ago · 17 replies · 1147 views
11 years ago

Is there anything to be done about hosting that disables exec()? I don't seem to be able to install anything.

11 years ago

Which is odd, come to think of it, because it installed stuff just fine on another server which I happen to know has exec() disabled.

11 years ago
TXT

  [Whoops\Exception\ErrorException]
  exec() has been disabled for security reasons

install [-f|--force] [-y|--all-yes] [-d|--destination [DESTINATION]] [--] <package> (<package>)...
11 years ago

I had forgotten about that, I guess we'll have to add that to the list of requirements for GPM. Just looking and exec() is used to execute some shell commands to do the unziping/moving/etc.

11 years ago

The funny thing is, on one server (the one I just installed the snipcart skeleton on) I happen to know they have exec() disabled, but gpm works just fine.

11 years ago

To be honest I've never seen anyone having this problem. Are you sure you are running the CLI version of php? what does php -v say?

11 years ago
TXT

Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd.```
11 years ago

As far as unzipping and moving files, I have an installer/upgrade script for MODX that doesn't use exec() for any of that.

11 years ago

Would be great if you were able to take your experience with the modx and provide a Pull Request that perhaps adds a PHP-fallback approach if exec() is not available. Ideally using exec() will be faster and more efficient than doing it via PHP, but a fallback would be cool.

11 years ago

I'll see what I can do. I'm mostly just an edge-case hacker, they call me the Corner Case Queen because for years I've been finding niggley little issues and usually providing the patches. I haven't looked at your PHP code at all yet.

11 years ago

Hm. This doesn't look promising. You use exec() a LOT.

11 years ago

Ok, not so much. A lot of false positives, probably need a better search criteria.

11 years ago

Way too many. Especially in the QuestionHelper and DialogHelper files. Not much point in dealing with the installer with all the rest of it. Will just need to make sure exec() and shell_exec() are enabled.

11 years ago

Do you really need to clone the git repository, or just get the files, on line 123 of cli/InstallCommand.php and on line 371 of /gpm/InstallCommand.php?

11 years ago

I learned something fascinating today. I use SkyToaster servers for most of my live work, and MODX Cloud development accounts for dev work. I was puzzled because I could run the gpm install for things on the MODX Cloud, but not on SkyToaster, and I knew that the MODX Cloud has exec() blocked. I found out that the MODX Cloud is configured to use a different php.ini for HTTP access than for SSH access. The reasoning is that a command-line user probably knows what he's doing, and from the command line having exec() blocked isn't going to be of much security use and will just be an annoyance to a developer.

11 years ago

SkyToaster and MODX cloud are hosted by the same provider?

11 years ago

No. SkyToaster is a provider, and the MODX Cloud is provided by the MODX LLC. I just thought it was an interesting way to configure a server with SSH access.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1333 9 years ago
Archive · by Muut Archive, 9 years ago
2 924 9 years ago
Archive · by Muut Archive, 9 years ago
2 4055 9 years ago
Archive · by Muut Archive, 9 years ago
1 2938 9 years ago
Archive · by Muut Archive, 9 years ago
3 1111 9 years ago