Cannot serve directory /home/public_html: No matching DirectoryIndex (index.html,index.php) found, and server-genera

MrDodd

Member
Mar 18, 2021
11
0
1
https://cuenta.rxenlinea.com/
cPanel Access Level
Root Administrator
Hi, I'm new to the forum, could you help me with this issue, thanks.

I am using a routing php file but the server sends me the following error:
Cannot serve directory /home/public_html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,492
1,008
313
cPanel Access Level
Root Administrator
Hey there! That error indicates that there is no readable index page in the directory that is specified as the document root for the domain. Normally the Apache server would expect to see an index.html or index.php file in the /home/user/public_html directory that it can read, but in your case that file is not there. The second part of the message is just letting you know that a directory listing, which can show the contents of your directory if there is no index page, has also been disabled.

Let me know if that helps!
 

MrDodd

Member
Mar 18, 2021
11
0
1
https://cuenta.rxenlinea.com/
cPanel Access Level
Root Administrator
Thanks for the support, look I have the htaccess in the root of my project with these rules.
Are they well defined?

Options -Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?url=$1 [NC,QSA,L]
 

MrDodd

Member
Mar 18, 2021
11
0
1
https://cuenta.rxenlinea.com/
cPanel Access Level
Root Administrator
@MrDodd - we'd need some more details to be able to help. Can you get me information about the autoloader system and any error messages you're seeing?
Hello CpRex, I'll explain what happens to me, I have a project which I develop in window 10, the project works perfectly,
when I migrated it to the hosting it began to give an error due to various issues which linux does not allow.
1. The issue of upper and lower case
2. Namespaces

I had to lowercase every example:
(Src \ User to src \ user), now no error but autoloader not working.
 

MrDodd

Member
Mar 18, 2021
11
0
1
https://cuenta.rxenlinea.com/
cPanel Access Level
Root Administrator
Hello CpRex, I'll explain what happens to me, I have a project which I develop in window 10, the project works perfectly,
when I migrated it to the hosting it began to give an error due to various issues which linux does not allow.
1. The issue of upper and lower case
2. Namespaces

I had to lowercase every example:
(Src \ User to src \ user), now no error but autoloader not working.
this is the autoloader


function autoload_once($class){
$path = str_replace('\\','/',$class.'.php');
if(!is_readable($path)) exit("Error al intentar cargar esta clase: $path");
require_once $path;
}
spl_autoload_register('autoload_once');

this work in windows perfectly
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,492
1,008
313
cPanel Access Level
Root Administrator
Unfortunately I don't have much info I can provide for this. I wouldn't necessarily expect a Windows application to work well in a Linux environment, so you may need some additional development work to happen on the Linux side of things in order to get that working.