Xampp files not showing up - php

I'm using Xampp no problem. I normally type localhost/assignment2 and the list of php pages I created come up but I just created an index.php page and now when I type localhost/assignment2 the index page is showing instead of my list a programs I made.
Is there a way I can rectify this or do I need to do something specific to it.

You server will always search for index.php, index.html and index.htm in your folder and show it if it exists. If none of these files exists the server shows a list of all files or an error, depending on your configuration.

This is happening because there is conflict between the name of xamp's index.php and the index.php that you have created.The same problem will arise if you create home.php. By default xamp gives preference to the index.php file and instead of showing the index of files it ends up displaying index.php. So the solution is to change your index.php filename to index1.php .

Related

index.php page not loading on main domain on a GCE VM instance

I've created Compute Engine VM instance and selected CentOS 7 as the image, on which I've installed cPanel, created a DNS zone and set up a firewall for.
After logging in into the Web Host Manager, I created a cPanel account, uploaded my PHP website into the public_html folder, and imported the SQL database into phpMyAdmin.
Now, the problem is that instead of loading index.php the site is showing index.html.
I checked the PHP version, and it is compatible with my website which is using alt-php 5.6. I've also installed ea-php 5.6 on the VM and changed the PHP version in cPanel on my domain.
However, the website's main domain is still loading index.html instead of index.php. Can someone help me understand why and how to fix it?
If you browser to /index.php does it work? If so and you're using Apache you'll want to set the "DirectoryIndex index.php" in the virtual host or in the ".htaccess" file.
Or if you can just delete the index.html file.
As far as I'm aware of, the default order of index file names that a server looks through is: index.htm, index.html, index.php and finally default.htm.
It is possible to change the name of the index file your account looks for by altering the .htaccess file, as already suggested by other user (in the example below, you'd set a file called "first.html" as the index page:
/#Alternate default index page
DirectoryIndex first.html
In case you need to have a specific custom name for your index file or maybe you are migrating from another host and the index page is named differently so your internal links won't be eventually broken by renaming the index file.
Greetings!

Change Website from Plain HTML to Wordpress

I have a static html website that I need to convert to Wordpress. I was able to successfully load wordpress on my hosting and configured a theme. However, the front end still displays the original html page. I need the whole website to be converted to wordpress, but I can't figure out where to add the htaccess and index.php files as I read from a blog. Someone help out.
Thanks
Sam
1) you're kind of asking for the whole of how the internet operates. I'm not saying that to be confrontational, just know that you'll likely be downvoted for such an impossible question.
2) more to the point, your server is looking for a directory index. In general, most servers look for index.html, index.htm, index.php, and then others, but in that order. If it encounters index.html in your directory then it stops and says that is the file to load.
3) you can get around this by changing the name of your file.
"index.html" -> "index_OLD.html" (or any name not index.html)
4) you can also change the way your server processes the index order using the DirectoryIndex directive in your HTAccess file. Ask your hosting provider about how to do this and if it's supported (although, I don't recommend you do this, it's just an available option).
5) your wordpress install should be in the root directory. That is to say, your .htaccess and index.php files should live in the same directory that your current index.html file lives in. Once the html file has a different name, the server will locate the php file and use it to server up as the directory index.
6) good luck friend!

How to set a custom Index.html in CPANEL?

I just wanna ask something.
I am using cuccfree.com for my free webhosting and Vista Panel for my CPanel.
in my CPANEL i have a folder named districtfive.cu.cc and it contains all of my files.
When Im trying to browse my link it always shows a list of Folders and Files of Index of.
My question is that how can I prevent to show all of that folders and instead show my website? I mean if i browse districtfive.cu.cc it will automatically open my Admin.php.
Does it have to do with:
Index Manager(My CPanel doesnt have that)
.htaccess(I dont know how to use it but i try but still noting happens.)
any suggestions or answer is highly appreciated. TY
Create an .htaccess file. Inside of this:
DirectoryIndex Admin.php index.php index.html
Seems like you're not using the default index.php. Also, any reason you're not using the default index.php nomenclature most people have come to expect?
Rename admin.php as index.php. It will automatically open your site with url 'districtfive.cu.cc'.

Unexpected Rewrite

On localhost, in one of my folders, files are accessible like http://localhost/folder/map instead of http://localhost/folder/map.php. It's probably because of something wrong with Apache's configuration but I'm stuck here and nothing comes to my mind.
If you have a file called index.php or index.html in your http://localhost/folder/map folder, Apache will run that file when you just enter the directory name as a browser url.
This is what makes http://localhost run a page rather than just showing you a directory listing, or show a blank page.
This is probably the reason that you see a valid page when just keying in the http://localhost/folder/map url.

Wamp Server showing blank page for nested directory

This link
http://localhost/
works fine.
This link doesn't work
http://localhost/shlingy/
directory location
C:\wamp\www\shlingy\index.html
Does anybody know why this link does not work?
Check whether there is a .htaccess file in www or www/shlingy directory or not. If there is, rename or remove it. Probably a rewrite rule in that file is causing the problem.
Also, make a index.html file in the www/shlingy directory which will be displayed when you access the shlingy.
It was a mistake on my end that i call a constructor of PHP file at the start page but that file contain an error. Its annoying that server just show blank page instead of error Massagining

Categories