Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 497433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:46:51+00:00 2026-05-13T05:46:51+00:00

How can I disable the dangerous eval function? Can that be done using ini_set

  • 0

How can I disable the dangerous eval function? Can that be done using ini_set function?

Also how to disable following functions? Can we disable them using ini_set function?

allow_url_fopen  
allow_url_include
exec
shell_exec
system
passthru
popen
stream_select

eval is one of the most dangerous function that bad guys can use to exploit the things. There should be a mechanism to disable that without resorting to php.ini file; but is should be done programatically.

Well, guys I am looking for an answers suggesting disabling of these dangerous lovely fellows without going to php.ini file; I mean how to disable them at runtime or programatically?

Thanks in advance….

Update

Has anyone heard about PHP Shell Offender Script? It mainly used the eval function for the exploit. Hackers are able to run their PHP code on your site.

My question was that I don’t want to disable the eval function from php.ini file altogether. For example, i have developed my own MVC framework. Now the framework users can specify from frameworks config file whether eval (and others) function should be disabled or not. So this is left to the choice of framework users. Once they specify to disable it; i should be able to disable the eval function programatically.

So that is the scenario. Looking for helpful answers/solutions.

Thanks Again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:46:52+00:00Added an answer on May 13, 2026 at 5:46 am

    To disable functions, mainly for security reasons, you can use the disable_functions directive in your php.ini configuration file.

    But, as the documentation states :

    This directive must be set in php.ini
    For example, you cannot set this in
    httpd.conf.

    I suppose this is too “internal” to be configurable anywhere else than in PHP… And as it’s security related, it’s up to the system administrator to configure it.

    Still, the best security measure is to write clean/secure code, filter all input, escape all output… And not let anyone run their own code on your server !

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In php.ini, the 'disable_functions' directive can be used to disable certain functions that you
I’ve read that you can disable (make physically unclickable) an HTML button simply by
How I can disable comments/rate in video using Visual Basic .NET ? Basically, how
Using this rather neat approach I can disable weekends and holidays from the datepicker.
In C++ you can disable a function in parent's class by declaring it as
In PHP I can disable code lines by using # or // or /*
I am using a function that will submit with ajax and without the help
you can disable the menu $(document).bind(contextmenu, function(e) { return false; }); you can show
I can disable one and one by doing this: jQuery('#ListBoxA').attr('disabled','true'); But how can I
I can disable viewstate of each control, but not entire page. Is there a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.