running gcc on server

wizkid

New Member
Messages
25
Reaction score
0
Points
0
could anyone please tell me how(if possible) i can run gcc on my server.
actually i wanted to compile a c program on my server
i tried using exec(), and shell_exec() function but none worked. it just showed permission denied. :(
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
I can predict that the answer will be a straight out no, it just leaves the servers way too open to attack or abuse. You cannot use the exec() command because you current PHP level will not allow it. Obviously, if they allowed everyone to compile their own things onto the server it would be a serious security risk.
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
The only package which has exec and shell_exec() is phpv3, and they allow it temporarily for MediaWiki installs. That is pretty much it.
 

wizkid

New Member
Messages
25
Reaction score
0
Points
0
i could actually run some of the commands on my server such has unpacking a tar file , directory listing etc.
i did try installing gcc on some other folder (othe than usr/bin), but i think i didnt had the privilgegs to use make command.
if Someone could please tell if i can run any compiler from my server it will be greatly appreciated.
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
i could actually run some of the commands on my server such has unpacking a tar file , directory listing etc.
i did try installing gcc on some other folder (othe than usr/bin), but i think i didnt had the privilgegs to use make command.
if Someone could please tell if i can run any compiler from my server it will be greatly appreciated.

Pretty much any compiler will require Exec or ShellExec since it has to run an executable.

I should point out as well that even if you -do- manage to get it to run, it'll likely cause a high resource usage suspension and end up killing your site for a while.


That being said, unpacking a tar file is probably similar to unpacking a zip and can be done via cpanel anyways, so that'd make sense to be allowed. Same goes for a directory listing - can do that via PHP if you wanted.


But unless you're using an x10 VPS, you won't be able to run any compiler without it also causing a high resource suspension. For more information I'd file a support ticket, although the answer's likely going to be "exactly -what- do you need this for?" followed by "No."
 
Top