# API Directory - Allow Code Execution (cPanel Configuration)
# Disable all security modules that might block code execution

# Disable ModSecurity entirely for this directory
<IfModule mod_security.c>
    SecRuleEngine Off
</IfModule>

<IfModule mod_security2.c>
    SecRuleEngine Off
</IfModule>

# Allow all HTTP methods (Apache 2.4+ syntax)
<RequireAll>
    Require all granted
</RequireAll>

# Alternative for Apache 2.2
<IfVersion < 2.4>
    Order allow,deny
    Allow from all
</IfVersion>

# Increase execution limits for code compilation
<IfModule mod_php7.c>
    php_value max_execution_time 60
    php_value memory_limit 256M
    php_flag display_errors Off
</IfModule>

<IfModule mod_php8.c>
    php_value max_execution_time 60
    php_value memory_limit 256M
    php_flag display_errors Off
</IfModule>

# Disable specific ModSecurity rules that commonly cause 403 errors
SecRuleRemoveById 300000 300001 300002
SecRuleRemoveById 950007 950009 950010 950011 950018
SecRuleRemoveById 973300 973301 973302 973303 973304 973305 973306 973307 973308 973309
SecRuleRemoveById 981173 981231 981242 981243 981244 981245 981246 981248 981249 981257

# Allow POST data with code content
SecRuleRemoveByTag "WEB_ATTACK"
SecRuleRemoveByTag "INJECTION"
