By guiprix
Hello, I’m getting mad to find how to make it works domain/index.php.
All component works well, PHP, apache2 is running, pahpmyadmin is ok. I can read index.html and info.php, but index.php not. where i should change the config to read domain/index.php??
tahnk s a lot Guiprix
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
In your site configuration for Apache in /etc/apache2/sites-enabled you need to make sure that index.php is listed as one of the files Apache will look for as an index (the file shown when you don’t specify a filename).
DirectoryIndex index.html index.htm index.php welcome.html
This is an example. In this case if you had both an index.html and an index.php the index.html would be loaded and index.php ignored.
DirectoryIndex index.php index.html index.htm welcome.html
This list is used in the order listed so by placing index.php as the first option your index.php will now be shown instead of index.html
could you tell me which exact file I have to edit in /etc/apache2/sites-enabled/ ?
In the file : sudo nano /etc/apache2/sites-enabled/000-default.conf , in this file i don’t have any <Directory > tag.
If i add under : DocumentRoot /var/www/html the following:
DirectoryIndex index.php
</Directory>```
index.php doesn't work. (HTTP error 500).
I found something similar of what you showed, in this file:
sudo nano /etc/apache2/mods-enabled/dir.conf , there i have the following:
```<IfModule mod_dir.c>
DirectoryIndex index.php index.cgi index.pl index.html index.xhtml inde$
</IfModule>```
i switch the 'index.php' at the beginning as suggested, but doesn't work either. And if I delete from this list 'index.html', the browser still show domain/index.html page correctly, so I presume it is not changed from here.
in my Filezilla i have:
/var/www/html
index.html (working)
index.php (not working)
info.php (working)
can you tell me what to do? because I am lost.
thanks a lot
any suggestion? should i upload to server an .htacess file via ftp to have it working?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.