(please specify the website or account you are asking about)
Directory Listing
(please share the FULL error message you see)
Directory listing
Username (e.g. epiz_XXX) or Website URL epiz_23464544 Error Message Directory Listing Other Information all the files in htdocs are php files with one css file. There is also a database created using phpMyAdmin and a sql query. Does a an index.php file work the same as an index.html file? Sorry for the confusion. Iām new to this.
So long as it is defined in the .htaccess file (Which by default it is), yes. It will work exactly the same with the only exception being that it will run PHP.
I have downloaded the .htaccess file and all it shows is:
##################################################
#
# DO NOT EDIT THIS FILE DIRECTLY
#
# Create a new .htaccess file in your htdocs
# directory (or example.com/htdocs/ directory)
# to add your own rules or override these rules.
#
##################################################
DirectoryIndex index.php index.html index2.html
ErrorDocument 400 https://infinityfree.net/errors/400/
ErrorDocument 401 https://infinityfree.net/errors/401/
ErrorDocument 403 https://infinityfree.net/errors/403/
ErrorDocument 404 https://infinityfree.net/errors/404/
ErrorDocument 500 https://infinityfree.net/errors/500/
ErrorDocument 503 https://infinityfree.net/errors/503/
which does not look like anything I have seen in online tutorials. I really have no idea how to correct this. Any suggestions?
Thanks for this. Seems to have cured the problem but now I get an error message āFailed to connect to database!ā which I think may have something to do with this section of the following code, which is set to display this error. I have changed host name etc to those shown in my cpanel and physically checked that the database does exist.
<?php
function pdo_connect_mysql() {
// Update the details below with your MySQL details
$DATABASE_HOST = 'localhost';
$DATABASE_USER = 'root';
$DATABASE_PASS = '';
$DATABASE_NAME = 'shoppingcart';
try {
return new PDO('mysql:host=' . $DATABASE_HOST . ';dbname=' . $DATABASE_NAME . ';charset=utf8', $DATABASE_USER, $DATABASE_PASS);
} catch (PDOException $exception) {
// If there is an error with the connection, stop the script and display the error.
die ('Failed to connect to database!');
Deleted everything and reinserted data. It appears to work! Only problem now is that the images will not display. Iāve been through all the files (copied from an external website) and changed the images src from āimgsā to āhtdocsā but still no joy.
htdocs is the folder of your website, but itās not part of your URL. If your image is located in the folder htdocs/photos/2020/mountain.jpg, then the URL is http://example.com/photos/2020/mountain.jpg`.
Also, please note that our servers are case sensitive. So Mountain.JPG and mountain.jpg are different files.