Is there any alternative function for symlink() to user in shared hosting servers that prevent symlink for security reasons? or at least how can i get the source code for this function?
Asked
Active
Viewed 3,063 times
0
-
Give some details on what specific error message you ran into. (No, there isn't an alternative PHP userland implementation for this system function. Use SSH or SFTP, or craft a CGI workaround if available.) – mario Feb 18 '15 at 17:51
-
the server auto delete php files that contain symlink function – Mhmoud Feb 18 '15 at 17:59
-
If you can't provide a more precise decription, then please consult your hosting provider instead. – mario Feb 18 '15 at 18:02
-
1symlink() has been disabled for security reasons on line ?? – Mhmoud Feb 18 '15 at 18:09
-
and in php.ini there is a line disable_functions = 'disk_free_space,disk_total_space,diskfreespace,escapeshellarg,escapeshellcmd,exec,highlight_file,link,passthru,popen,proc_close,prog_get_status,proc_nice,proc_open,proc_terminate,set_time_limit,shell_exec,show_source,symlink,system,tmpfile,tempnam' – Mhmoud Feb 18 '15 at 18:10
-
and hosting provider cannot remove this function from disable_functions list – Mhmoud Feb 18 '15 at 18:11
1 Answers
0
You can do it as a exec command instead.
exec('ln -s /path/to/file /path/to/symlink');
How to symlink a file in Linux? goes into more details about doing server side symlinks.