Which PHP functions are required for OJS and plugins?

Hello everyone,

The following PHP functions are disabled by default by my server service provider. Which PHP functions need to be turned on for OJS and plugins to work properly. I couldn’t find a complete list in the developer documentation.

Disabled PHP functions
getmyuid,passthru,leak,listen,diskfreespace,tmpfile,link,shell_exec,dl,exec,system,highlight_file,source,show_source,fpassthru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_open,proc_close,proc_nice,proc_terminate,escapeshellcmd,ini_alter,popen,pcntl_exec,socket_accept,socket_bind,socket_clear_error,socket_close,socket_connect,symlink,posix_geteuid,ini_alter,socket_listen,socket_create_listen,socket_read,socket_create_pair,stream_socket_server

What application are you using?
OJS 3.4.0-7

Hi @asmecher,

Can you clarify this for me?

Best,

Hi @peditor,

This is a pretty tough question to answer in general because you can disable any PHP function, and OJS uses lots of 3rd party libraries that might use some of these functions. But I see at least a few that OJS will probably require: tmpfile, shell_exec, exec, system, diskfreespace, passthru, proc_open, proc_close, escapeshellcmd. There will probably be others. When you attempt to use one of these but it’s disabled, a clear error message will be recorded in the PHP error log to help you resolve it.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

You could also do a recursive grep for these functions in the OJS code to find out.