SOLVED Unable to execute any php or html file

Tarak Nath

Well-Known Member
Mar 12, 2018
119
15
68
India
cPanel Access Level
Root Administrator
Hello,

We can able to execute any html or php file via 123.45.67.89/~user/index.html or 123.45.67.89/~user/index.php but not able to do the same through domain like example.com or example.com/index.html or example.com/index.php

Can you suggest whats going wrong with our server please?

Code:
[[email protected] ~]# /usr/local/cpanel/cpanel -V
78.0 (build 21)

[email protected] [/]# cat /var/cpanel/envtype
standard

[[email protected] ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

[[email protected] ~]# php -v
PHP 7.1.28 (cli) (built: Apr 23 2019 18:00:17) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.3.2, Copyright (c) 2002-2018, by ionCube Ltd.
Regards,
Tarak Nath
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello @Tarak Nath,

Here's a quote from my response to your other thread (the response is the same for this issue):

There are several limitations when using the Apache Mod_Userdir URL to access a website. These are documented at:

Apache mod_userdir Tweak - Version 78 Documentation - cPanel Documentation

The better approach to access a website before it's DNS resolves to your server is to modify the hosts file on your individual workstation:

How to Modify your hosts File - cPanel Knowledge Base - cPanel Documentation

Can you let me know if the issue persists when accessing the website using the method documented in the link above?
Thank you.
 

Tarak Nath

Well-Known Member
Mar 12, 2018
119
15
68
India
cPanel Access Level
Root Administrator
Hello,

Thank you for your response.

Please note that we are using suPHP handler in our server. It will worki if we disable "mod_userdir" ?

Regards,
Tarak Nath
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Please note that we are using suPHP handler in our server. It will worki if we disable "mod_userdir" ?
Hello @Tarak Nath,

To confirm, the "index.html" and "index.php" files are only accessible using the Mod_Userdir URL? Or, are you stating they are not accessible using the Mod_Userdir URL? Are you opening them via a web browser, or through another method? Also, can you share the output to the Apache error log during the failed attempts to execute the "index.html" and "index.php" pages?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Yes, they (index.php or index.html) are not accessible via web browser.
In this case, try accessing the domain names using the hosts file method referenced in my earlier response to verify if they are accessible using that method.

Thank you.
 

Tarak Nath

Well-Known Member
Mar 12, 2018
119
15
68
India
cPanel Access Level
Root Administrator
Hello,

We have found the main reason. There was firewall which created the issue. For security reason, there is a rule for domain name specific traffic request enable /disable.

We have allowed the said domain through firewall and its perfectly working.

Thank you for everything.

Please mark this thread as SOLVED.

Regards,
Tarak Nath
 
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello @Tarak Nath,

I've marked this thread as solved. Thanks for sharing the outcome!