403 forbidden Error. htaccess file could not be read

Status
Not open for further replies.

cscrovx1

New Member
Messages
28
Reaction score
0
Points
1
Good day.

My site has a subdomain, exam. cscrov.x10.mx. I get the subject error whenever I try to access it.

I have already tried reading threads with the same problem and tried the suggested solutions like editing the htaccess file and adding the lines suggested, to no avail.

May I please request for assistance on the matter?

Thanks so much.
 

Anna

I am just me
Staff member
Messages
11,733
Reaction score
578
Points
113
Did you expect a list of your files/folders on that address? If so you will need to create a .htaccess and add the following line, without quotes: "Options +Indexes"

Directory listing is turned of by default, while it may have been turned on for your account under cPanel even without that directive since only later versions of cPanel had it off by default.
 

cscrovx1

New Member
Messages
28
Reaction score
0
Points
1
Did you expect a list of your files/folders on that address? If so you will need to create a .htaccess and add the following line, without quotes: "Options +Indexes"

Directory listing is turned of by default, while it may have been turned on for your account under cPanel even without that directive since only later versions of cPanel had it off by default.

Thanks for the reply. No, I am not expecting a list of files/folders, just the display of the index.php page.

Edit:

Incidentally, this is what the error log for the subdomain has as the first line:

Wed Feb 12 00:11:49.773938 2020] [ssl:warn] [pid 10110:tid 140576095717504] AH01909: www.exam.cscrov.x10.mx:443:0 server certificate does NOT include an ID which matches the server name

This is the second line:

[Wed Feb 12 00:46:27.181619 2020] [core:crit] [pid 1317123:tid 140574799550208] (13)Permission denied: [client 77.88.47.161:40328] AH00529: /home/cscrovx1/domains/cscrov.x10.mx/public_html/exam/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/cscrovx1/domains/cscrov.x10.mx/public_html/exam/' is executable

Most lines that come after that are similar in content.
 
Last edited:

cscrovx1

New Member
Messages
28
Reaction score
0
Points
1
I am also trying to remove the sub domain and try to recreate it because I'm thinking this must be an issue after the migration, but I get the following error in deleting the sub domain:

Script output: subdomain_destroy_pre.sh
/usr/local/directadmin/plugins/gdns-transferserver/hooks/domain_hook_manage.php: line 2: ?php: No such file or directory
/usr/local/directadmin/plugins/gdns-transferserver/hooks/domain_hook_manage.php: line 3: syntax error near unexpected token `'ionCube Loader''
/usr/local/directadmin/plugins/gdns-transferserver/hooks/domain_hook_manage.php: line 3: `if(!extension_loaded('ionCube Loader')){$__oc=strtolower(substr(php_uname(),0,3));$__ln='ioncube_loader_'.$__oc.'_'.substr(phpversion(),0,3).(($__oc=='win')?'.dll':'.so');if(function_exists('dl')){@dl($__ln);}if(function_exists('_il_exec')){return _il_exec();}$__ln='/ioncube/'.$__ln;$__oid=$__id=realpath(ini_get('extension_dir'));$__here=dirname(__FILE__);if(strlen($__id)>1&&$__id[1]==':'){$__id=str_replace('\\','/',substr($__id,2));$__here=str_replace('\\','/',substr($__here,2));}$__rd=str_repeat('/..',substr_count($__id,'/')).$__here.'/';$__i=strlen($__rd);while($__i--){if($__rd[$__i]=='/'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}if(function_exists('dl')){@dl($__ln);}}else{die('The file '.__FILE__." is corrupted.
");}if(function_exists('_il_exec')){return _il_exec();}echo("Site error: the ".(php_sapi_name()=='cli'?'ionCube':'ionCube')." PHP Loader needs to be installed. This is a widely used PHP extension for running ionCube protected PHP code, website security and malware blocking.

Please visit ".(php_sapi_name()=='cli'?'get-loader.ioncube.com':'get-loader.ioncube.com')." for install assistance.

");exit(199);'

Error writing the db file: Script output: /usr/local/directadmin/scripts/custom/dns_write_post.sh
/usr/local/directadmin/plugins/gdns-transferserver/hooks/domain_hook_manage.php: line 2: ?php: No such file or directory
/usr/local/directadmin/plugins/gdns-transferserver/hooks/domain_hook_manage.php: line 3: syntax error near unexpected token `'ionCube Loader''
/usr/local/directadmin/plugins/gdns-transferserver/hooks/domain_hook_manage.php: line 3: `if(!extension_loaded('ionCube Loader')){$__oc=strtolower(substr(php_uname(),0,3));$__ln='ioncube_loader_'.$__oc.'_'.substr(phpversion(),0,3).(($__oc=='win')?'.dll':'.so');if(function_exists('dl')){@dl($__ln);}if(function_exists('_il_exec')){return _il_exec();}$__ln='/ioncube/'.$__ln;$__oid=$__id=realpath(ini_get('extension_dir'));$__here=dirname(__FILE__);if(strlen($__id)>1&&$__id[1]==':'){$__id=str_replace('\\','/',substr($__id,2));$__here=str_replace('\\','/',substr($__here,2));}$__rd=str_repeat('/..',substr_count($__id,'/')).$__here.'/';$__i=strlen($__rd);while($__i--){if($__rd[$__i]=='/'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}if(function_exists('dl')){@dl($__ln);}}else{die('The file '.__FILE__." is corrupted.
");}if(function_exists('_il_exec')){return _il_exec();}echo("Site error: the ".(php_sapi_name()=='cli'?'ionCube':'ionCube')." PHP Loader needs to be installed. This is a widely used PHP extension for running ionCube protected PHP code, website security and malware blocking.

Please visit ".(php_sapi_name()=='cli'?'get-loader.ioncube.com':'get-loader.ioncube.com')." for install assistance.

");exit(199);'
 

Anna

I am just me
Staff member
Messages
11,733
Reaction score
578
Points
113
I found two separate issues, the first was the permissions were all wrong (in general a folder needs 755 and a file needs 644, you had some sort of in between for them all, namely 754), I have corrected this.

The second issue was your script uses mysql_ statements, and that extension was removed from php starting with version 7.0 (all accounts were set to 7.2 in the transfer), the extension is replaced with the more secure mysqli_ and PDO. I changed the version for you but you might want to look into having the script updated to use mysqli (it is usually as easy as just replacing mysql_ with mysqli_ in all instances).
 

cscrovx1

New Member
Messages
28
Reaction score
0
Points
1
Thank you very much for the assistance. I have already changed to PDO and will upload the replacement files soon.

Again, your help is much appreciated!
 
Status
Not open for further replies.
Top