404 on any .PHP custom file
Hi all,
I have strange issue with one of the accounts on my WHM.
This is the only account affected.
Issue:
I am running Wordpress 5.2.2 (just like other accounts on this server) - I have some custom work to do with the site and it requires to create custom .php files. These files which I need to use across the site are returning 404 not found. I tested the same files on other accounts on this server and this is only happening on this account.
Things I tried:
- Update permalinks in wordpress
- Rename htaccess
- Revert htaccess to default
- Change settings in php.ini
- Move the file around inc. root directory
cPanel error:
SoftException in Application.cpp:267: File "/home/tackpackaging/public_html/phpinfo.php" is writeable by group
HTACCESS:
PHP.ini
.user.ini
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
# php -- BEGIN cPanel-generated handler, do not edit
# Set the "ea-php72" package as the default "PHP" programming language.
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
# php -- END cPanel-generated handler, do not edit
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (PHP Home - EasyApache 4 - cPanel Documentation)
php_flag display_errors Off
php_value max_execution_time 30
php_value max_input_time 60
php_value max_input_vars 1000
php_value memory_limit 32M
php_value post_max_size 8M
php_value session.gc_maxlifetime 1440
php_value session.save_path "/var/cpanel/php/sessions/ea-php72"
php_value upload_max_filesize 2M
php_flag zlib.output_compression Off
php_flag display_errors Off
php_value max_execution_time 30
php_value max_input_time 60
php_value max_input_vars 1000
php_value memory_limit 32M
php_value post_max_size 8M
php_value session.gc_maxlifetime 1440
php_value session.save_path "/var/cpanel/php/sessions/ea-php72"
php_value upload_max_filesize 2M
php_flag zlib.output_compression Off
# END cPanel-generated php ini directives, do not edit
PHP.ini
; cPanel-generated php ini directives, do not edit
; Manual editing of this file may result in unexpected behavior.
; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
; For more information, read our documentation (PHP Home - EasyApache 4 - cPanel Documentation)
allow_url_fopen = Off
allow_url_include = Off
display_errors = Off
enable_dl = Off
file_uploads = On
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 32M
post_max_size = 8M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php72"
upload_max_filesize = 2M
zlib.output_compression = Off
.user.ini
; cPanel-generated php ini directives, do not edit
; Manual editing of this file may result in unexpected behavior.
; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
; For more information, read our documentation (PHP Home - EasyApache 4 - cPanel Documentation)
display_errors = Off
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 32M
post_max_size = 8M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php72"
upload_max_filesize = 2M
zlib.output_compression = Off-
Nvm, still not working 0 -
This has to due with how the wordpress redirects are handled. Adding a "ErrorDocument 401 default" to the top of your .htaccess can fix the issue sometimes. If that does not do it, you can add a rewrite condition to allow the custom files to exit the redirect rule. As for - SoftException in Application.cpp:267: File "/home/tackpackaging/public_html/phpinfo.php" is writeable by group This typically means that you're using permissions higher than 644 for the file. 0 -
I am running Wordpress 5.2.2 (just like other accounts on this server) - I have some custom work to do with the site and it requires to create custom .php files. These files which I need to use across the site are returning 404 not found. I tested the same files on other accounts on this server and this is only happening on this account.
Other accounts have wordpress installed in them?0 -
Yes, same versions etc. 0 -
The php files are created in the root wordpress install directory or in a subfolder? 0 -
Any where - I just created a test.php with and it does not work - 404 page where ever I put it. 0 -
Is anything noted in the Apache error log when you go to a custom php page? 0 -
Is there a caching plugin in use? 0
Please sign in to leave a comment.
Comments
8 comments