Php ini system exec

Содержание
  1. How To Enable or Disable Shell_exec in PHP
  2. Disable Exec() in PHP.ini
  3. Share this post
  4. Popular Posts
  5. From our Knowledgebase
  6. Quick Links
  7. Contact Us
  8. Follow Us
  9. web developer, SSL certificate, web DEVELOPER Nigeria, web design abuja, website designer in abuja, ynet interactive, SCHOOL SOFTWARE, business SOFTWARE in abuja, web DEVELOPMENT COMPANY in abuja, web DESIGNER in nigeria, WEB PORTAL developer in abuja, best web DEVELOPMENT COMPANY in nigeria, best web design abuja, best web designers in abuja, top web DEVELOPMENT firm, top DEVELOPMENT firms, Nigeria, web developer, bulk sms website design nigeria, bulk SMS SOFTWARE, responsive website, SCHOOL PORTAL development in Nigeria, school software, Nigerian website designer company, web hosting companies in nigeria, website designer, web designers in nigeria, branding company in nigeria, abuja branding agency, responsive website designer, ssl certificate company, buy ssl nigeria, ERP, ERP solution nigeria, web site developer in Nigeria, software firm, software development in abuja, web portal developers, business applications, web, MOBILE APPLICATION development, MOBILE APP DEVELOPMENT, mobile developer in nigeria, mobile app abuja, app development company, school website design, online store developer in abujanigeria, school website hosting, android app developer, ios app developer in nigeria,web application nigeria, mobile application developer, best mobile developer abuja nigeria, BUY SSL certificate nigeria, ssl certificate in nigeria, domain registration, bulk sms software
  10. How to enable exec function in php.ini : Let’s figure it out
  11. What is the exec function?
  12. Security risk in enabling exec function
  13. How we enable exec function in PHP?
  14. Using php.ini to enable exec function
  15. MultiPHP INI Editor
  16. Conclusion
  17. PREVENT YOUR SERVER FROM CRASHING!
  18. 2 Comments
  19. Php ini system exec
  20. How to enable exec()
Читайте также:  Java hibernate hbm xml

How To Enable or Disable Shell_exec in PHP

Open the PHP.ini file and remove ?exec? on ?disable_functions?:

disable_functions=show_source, system, shell_exec, exec

So it will become like this:

disable_functions=show_source, system, shell_exec

Then restart PHP service, use one of these commands:

/etc/init.d/php-fpm restart /etc/init.d/php5-fpm restart /etc/init.d/php7.0-fpm restart

Disable Exec() in PHP.ini

Open the PHP.ini file and add ?exec? on ?disable_functions?:

disable_functions=show_source, system, shell_exec

So it will become like this:

disable_functions=show_source, system, shell_exec, exec

Then restart PHP service, use one of these commands:

/etc/init.d/php-fpm restart /etc/init.d/php5-fpm restart /etc/init.d/php7.0-fpm restart

Share this post

From our Knowledgebase

Contact Us

  • Phone: +234 (0) 1 700 6727
  • Email:info [at] ynetinteractive.com
  • Skype: ynet.interactive
  • Working Days/Hours: Mon — Fri / 8:30 AM — 5:30 PM

Follow Us

Ynet Interactive

web developer, SSL certificate, web DEVELOPER Nigeria, web design abuja, website designer in abuja, ynet interactive, SCHOOL SOFTWARE, business SOFTWARE in abuja, web DEVELOPMENT COMPANY in abuja, web DESIGNER in nigeria, WEB PORTAL developer in abuja, best web DEVELOPMENT COMPANY in nigeria, best web design abuja, best web designers in abuja, top web DEVELOPMENT firm, top DEVELOPMENT firms, Nigeria, web developer, bulk sms website design nigeria, bulk SMS SOFTWARE, responsive website, SCHOOL PORTAL development in Nigeria, school software, Nigerian website designer company, web hosting companies in nigeria, website designer, web designers in nigeria, branding company in nigeria, abuja branding agency, responsive website designer, ssl certificate company, buy ssl nigeria, ERP, ERP solution nigeria, web site developer in Nigeria, software firm, software development in abuja, web portal developers, business applications, web, MOBILE APPLICATION development, MOBILE APP DEVELOPMENT, mobile developer in nigeria, mobile app abuja, app development company, school website design, online store developer in abujanigeria, school website hosting, android app developer, ios app developer in nigeria,web application nigeria, mobile application developer, best mobile developer abuja nigeria, BUY SSL certificate nigeria, ssl certificate in nigeria, domain registration, bulk sms software

Services
Design

Источник

Читайте также:  Google authenticator api java

How to enable exec function in php.ini : Let’s figure it out

Exec is a PHP function used to execute an external program like a script.

But the execution of external programs creates a security risk that attackers can misuse.

At Bobcares, we often get requests to enable PHP functions, as part of our Server Management Services.

Today, let’s see how our Support Engineers enable this function. We’ll also discuss the security risk related to the exec function.

What is the exec function?

The exec is an inbuilt PHP function. It replaces a currently running process with the new program. PHP uses the function to execute a program and it returns the last line of the output.

Many WordPress image optimization plugins make use of this function. Hence WordPress users often approach us to enable this function.

Security risk in enabling exec function

PHP has certain dangerous functions that can make a server vulnerable to attacks. These functions include system, passthru, shell_exec, exec, etc.

Hence our Support Engineers always recommend our customers to disable these functions in the server. And these functions will be listed in the disable_functions directive in a php.ini file.

How to enable exec function in php.ini

By enabling exec function there is a possible security threat. Attacks may use this function to run programs in servers that can lead to data corruption and data loss.

Considering the security risks, we suggest customers enabling the exec function on a per-account basis. Thus, it gives better tracking of user activity.

How we enable exec function in PHP?

One of the wisest choices is to enable the exec function in dedicated or VPS servers.

Usually, we enable this function via the php.ini file. But for cPanel accounts, we can do this via WHM. Now, let’s see how our Support Engineers enable it.

Using php.ini to enable exec function

To enable this function, we login to the server as the root user.

Then we open the php.ini file and search for exec function. Usually, this function will be disabled. So, we check the disable_functions directive which appears as,

disable_functions = "show_source, system, shell_exec, exec"

Hence we remove exec from the line and save the file. Thus we enabled the exec function in the server.

In addition, if the PHP handler is suPHP or LSPHP, then we have to add the directive in the .htaccess file also.

MultiPHP INI Editor

For cPanel customers we enable the exec function from the WHM. But the change will reflect in all cPanel accounts in WHM. So we don’t use this method to enable exec in one cPanel account.

  • To enable the function in all the accounts, we log in to the WHM.
  • Then we select the MultiPHP INI Editor from the Software section.
  • Next, we enter into the Editor Mode and choose the corresponding PHP version.
  • There we remove the exec function from disable_functions directive.
  • Finally, we save the changes.

Hence it enables the function server-wide.

[Need more help to enable PHP functions? – We’re available 24/7.]

Conclusion

In short, exec function is usually disabled in a server, as it allows attackers to execute external programs that can crack a server. Today, we saw how our Support Engineers enable exec function in php.ini.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

2 Comments

hello, is there any other ways to enable this function without touching php.ini ? i dont have access to php.ini in my host. Reply

Hello Erfan,
Enabling the exec function needs access to the php.ini file. Considering security risks, most Hosting providers control this function at the root access level.
A VPS server with root access allows you to do such customization. Reply

Источник

Php ini system exec

U.S. Dollar Euro British Pound Canadian Dollars Australian Dollars Indian Rupees China Yuan RMB More Info →

We stand with our friends and colleagues in Ukraine. To support Ukraine in their time of need visit this page.

How to enable exec()

You can modify different php settings for your account using a php.ini file. We recommend using our default php.ini file which is the most compatible with our servers and was specifically created to optimize the process of php values modification. You can learn how to find and edit php.ini on our shared servers here:

To enable exec() function, you need to remove it from the following line in your php.ini file:

disable_functions = «show_source, system, shell_exec, exec»

1. Open your php.ini and find the following section:

2. Remove exec from the line and click on Save Changes:

3. If you need to disable show_source, system or shell_exec as well, just add them back to the line and save the changes.

If your account is hosted on a shared server, the suPHP or LSPHP configuration directive should be added to your .htaccess file to make these settings global for the entire account. You can find step-by-step instructions here.

In case your account is located on a business server, no other modifications should be applied.

Need any help? Contact our HelpDesk

Источник

Оцените статью