Using of register_globals for improve PHP performance ?

disabling the register_globals option in PHP can improve performance. When register_globals is enabled, all variables from the HTTP request are automatically registered as global variables. This can add overhead to PHP applications, as the PHP interpreter has to check whether a variable exists in the global scope before it can be accessed.

Disabling register_globals forces developers to explicitly declare all global variables. This can improve performance by reducing the overhead of registering and deregistering global variables. Additionally, disabling register_globals can help to improve the security of PHP applications by making it more difficult for attackers to exploit vulnerabilities.

Here are some additional benefits of disabling register_globals:

  • Reduced memory usage: Registering global variables can increase the memory usage of PHP applications.
  • Easier debugging: Disabling register_globals can make it easier to debug PHP applications, as developers will be able to see which variables are actually global.
  • Improved compatibility: Disabling register_globals is compatible with newer versions of PHP and other web frameworks.

If you are using an older PHP application that relies on register_globals, you should consider migrating your application to a newer version of PHP and disabling register_globals. This will improve the performance, security, and maintainability of your application.

Example :-


Go to php.ini and put below code


After making the changes, save the file and restart your web server (Apache) for the changes to take effect.

Disabling register_globals is a good security practice, as it can help to prevent attackers from exploiting vulnerabilities. It is also a good performance practice, as it can reduce the overhead of registering and deregistering global variables.

Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.

Related Posts

Using of mod_expires caching for improve Performance ?

What is mod_expires caching ? Mod_expires caching is a powerful tool that can be used to improve the performance of your website. By caching static files, mod_expires…

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x