How to run a php project in localhost using XAMPP? - php

First of all, I'm using Kali Linux. I have a project, it's a folder with .php files. I want to run it to see it on the browser, so it needs to be localhost. Folder name is "CMSsite". I moved the folder to /opt/lampp/htdocs folder to access it through typing on the browser localhost/CMSsite. When I open the browser and type localhost/CMSsite/ I see the message "The requested URL was not found on the server"
enter image description here
How can I solve this problem?

Related

Codigniter is not working after uploading to Linux server

Created an application using Codeginiter and is working fine with my local environment which is in XAMPP.
After uploading application folders and files to linux server application is not working at all.
Deployed complete files under "/var/www/html/" and when access from browser it gives me CI error as "404 Page Not Found".
After uploading, I have updated .htaccess file.
I think this is about Linux file permission. You might want to check its file permission.
try to change the permission to read, write and executed by you ONLY example:
sudo chmod 700 var/www/html

Browser shows 404 Resource not found error even after pasting php file in htdocs folder in xampp folder

I have installed xampp and configured the browser to listen to port 8000.I saved the file using a .php extension selecting the all files option while saving and saved it in the htdocs folder.Still when I use localhost\mypage.php it shows the resource not found error.
Copied the code into notepad and placed the file in htdocs folder and opened it in netbeans and it was working fine.

PHP localhost issue. Folder not opening when clicked inside localhost

I just installed WAMP server to start practicing PHP. I created a folder in www directory. However, when I try to run the file from localhost it does not run.
For ex, I created a folder "test" in www directory. I saved an HTML file called "test.html" inside the test folder. Basically I have saved it in www --> test --> test.html.
I started localhost in my browser. I found test folder there. But when I click that test folder, instead of opening as "localhost/test", it is opening as just "test/". How to make sure that the folder, when clicked inside localhost, should open as "localhost/<foldername" (in this case "localhost/test").
When I type as "localhost/test" in my browser, it works fine. But when I go to localhost and click on "test" folder it does not open.
Please help me to overcome this.
Thanks in advance.
You should type the file name and the extension to open the file from the local host as your file is not index.html
so you should go to "localhost/test/test.html" that would work
if you want your file to

xampp is not showing .php files saved in htdocs folder

I am using windows 7 and just installed xampp server to "E:\xampp" in my laptop to learn php. Now the problem is whenever I start xampp server by starting "xampp_start" in xampp folder and start Apache and MySQL from "xampp-control" and type localhost in my browser it automatically gets converted into "localhost/xampp/" and display a default page instead of displaying the .php file which I created in htdocs folder. Another problem is when I created a folder in htdocs folder and saved a index.php and another .php file which was created by me, it is not showing that folder too. I know this question has been asked before but I didn't get any solution from there because I started xampp_start from xampp folder and Apache & MySQL from xampp-control. So please help. Thanks in advance.
This is the default picture which is being displayed:
Thing is if you create any .php file in htdocs folder, you have to run that file as "localhost/filename.php" but if you created any folder in htdocs, for example folder name is "work" then you have to type "localhost/work/" and then it will show file contained in that folder.
First copy the files of htdocs and paste on any drive and delete the htdocs folder then create another folder and paste the files in this folder and restart the server.
First make sure you go to Local Disk (C:), then go to xampp -> htdocs-> and create your folder.
Hi Guys Here Iam Gonna Show You How You Can Fix This Error
Follow me
Don't worry ! If xampp is not showing .php files in htdoc/folder OK:
Just change the name of that file which is not showing and refresh or reopen the localhost directory it will-be show
Your file
If this method work or not comment below
Good luck and keep it up.
#gamerinc

Access forbidden in linux mint for apache localhost

I am doing PHP development using Linux OS ,Lampp Apache server.I changed the default root folder htdocs to another folder PHP on my desktop. When I create a hello.php file in the folder ,I can see it in browser and works well.
But I have another folder inside this root folder called 'front_end'.When I try to see it in browser using http://localhost/front_end ,i get access forbidden.
Firebug shows 'Access forbidden'
How can I get access to this folder using localhost?
Another user asked a similar question on stackoverflow ,but it didn't help.
Ubuntu/Apache2/ Forbidden/Permission error
Assuming you have followed the advice regarding the file permissions.
Have you got an index.php file in the front_end directory?
If not that may be why you get 'Access forbidden'. See Apache 403 Forbidden Error and Solution Try accessing the spesific php file in the directory e.g. /front_end/test.php
Permissions on the folder
Check the permissions of the folder.
Use sudo to create the folders.

Categories