Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a task that PHP (or any server-side scripting language) isn't practical for. It involves a lot of file I/O, processing, etc. and it will execute a lot faster using the program I made in C instead of PHP.

Do any hosts allow you to upload your own EXE files and run them on the server using PHP's exec, shell_exec, etc. functions?

Do you need a dedicated server to do this?

Also, I don't know if Facebook's PHP HipHop is out yet, but I really don't want to use that.

share|improve this question

migrated from Apr 12 '10 at 3:13

This question came from our site for professional and enthusiast programmers.

You probably will need a dedicated server to do such a thing. Typically the exec function is disabled for obvious security reasons; a shared server would not want an executable such as yours eating tons of CPU time for everyone else.

Perhaps look into cloud hosting, such as Amazon EC2? This way you could start up your own virtual private server and run your application in its ideal environment. Also since you said "EXE" I assume it's a Windows application, and you can indeed run a Windows environment on EC2, whereas most PHP hosts run Linux machines.

share|improve this answer

Why don't you write a CGI script in C and compile it. You could then take advantage of the speed of a compiled script and still keep in a format that the host is comfortable with.

share|improve this answer
You could even make it a PHP extension or a webserver module if the overhead of CreateProcess() is too much for you. – Alexandre Jasmin Apr 12 '10 at 3:33

Nearly Free Speech says that C/C++ is welcome: CGI Support. It's also a great service and very cheap -- even for shared hosting.

If you want a dedicated virtual server, Slicehost, Rimu, and Linode are far cheaper than EC2 if scaling isn't a big issue for you.

share|improve this answer

You can consider getting a VPS hosting. They're cheaper than dedicated hosting and you pretty much can do whatever you want within your VM sandbox.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.