Cantech Knowledge Base

Your Go-To Hosting Resource

How to Disable PHP Functions using Control Panel?

Introduction

Disabling some PHP functions helps make your website more secure. Some functions are risky in case a hacker is able to access them. Therefore, you can simply turn them off from your hosting control panel. This approach assists in preventing code injection attacks. It adds an extra security layer to your site.

What are PHP Functions?

PHP functions are pre-written blocks of code that are already written. They perform specific tasks. As an example, some functions handle file uploads and others connect to a database.

Moreover, the php.ini is a PHP configuration file that controls many PHP settings. You can edit this file to disable specific functions. This is a typical way of enhancing the security of the server.

How to Disable PHP Functions

The php.ini file can be edited using your control panel. This is a simple process.

Log in to your control panel: Visit the login page of your hosting control panel and sign in.

Locate PHP settings: Go to the CGI or Scripted Language Support section. Click on PHP Scripting.

Open php.ini file: php.ini file will be there in a text box. It is a place where you can change things. In case the text box is read-only, then click the Edit button.

Locate the disablefunctions line: Find the line that begins with disablefunctions=. This line controls the functions that are disabled. It might look like this:

; http://php.net/disable-functions

disablefunctions=

Add the functions to disable: Enter the names of the functions that you wish to disable. Separate each name of function with a comma. These functions are able to execute system commands. Here are some examples:

  • exec
  • passthru
  • shellexec
  • system
  • procopen
  • popen
  • curlexec
  • curlmultiexec

Now, your line must be like this:

disablefunctions=exec,passthru,shellexec

Save the changes: Click on the Save button. The modifications will be put into practice.

Web Hosting Features at Cantech

The hosting plans of Cantech include a powerful control panel. It is easy to control your settings through the same. You can easily access and edit your php.ini file. This provides you with control over the security of your server. Our platform is secure and performance-oriented. Also, our support is at your service 24/7.

Conclusion

It is a smart security measure to disable unused or dangerous PHP functions. It assists in securing your website against possible attacks. This little change of editing the php.ini file using your control panel can significantly enhance the security posture of your website. It assists in making your site secure.

FAQs

Why should I disable PHP functions?

The PHP functions should be turned off for security reasons. Attackers can exploit some of the functions. These functions can also be used by them to execute malicious code on your server.

How do I know which functions to disable?

You should disable functions that are not needed. You can turn off functions that can run system commands – common ones are exec, shellexec and system.

Will this affect my website’s functionality?

Yes, when the disabled function is used in your website code, it will stop working. Before you disable functions, you ought to check the scripts of your website.

Is it possible to re-enable a functionality in the future?

Yes, all you need to do is log in again to your control panel. Make changes to the disablefunctions line and delete the name of the function in the list. Save the changes.

Is this the only way to secure a PHP website?

No, this is just one step. Website security is a combination of many things. You are also to use good passwords and update on the software. You should also use secure coding practices.

January 12, 2026