Access forbidden in linux mint for apache localhost - php

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.

Related

XAMPP Apache not working on Ubuntu 20.04.3 LTS

I have been searching for hours now and I cant find a solution. I have tried much to many things to even start listing the things. So please any assistance would be appreciated.
I have changed the htdocs folder location in httpd.conf because I have all my files sync to cloud storage. This works perfectly on my windows machine but on linux not so much. Every thing runs perfectly but when I try to access my htdocs folder (new location) I get a message:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.48 (Unix) OpenSSL/1.1.1k PHP/8.0.10 mod_perl/2.0.11 Perl/v5.32.1
But When I change the location back to the normal location it works perfectly.
I have already gave full access to the folder.
Think of a directory structure as a series of security doors:
/var
/www
/htdocs
If you give someone a key to htdocs (i.e. set the permissions to give a user access) then they can open that door… but only if they can get to it.
If you don't also give them keys to www and var then they can't get into htdocs.

htaccess file and how to change permission's in it?

I have created a new folder example inside /var/www/html/ to run some php code. But when I try to access the files via localhost/example it is showing-
Forbidden
You don't have permission to access this resource.Server unable to read htaccess file, denying access to be safe
Apache/2.4.46 (Ubuntu) Server at localhost Port 80
The other files in the /var/www/html folder like localhost/welcome.php are still working. I also changed permission of the files. Should I create htaccess file and if so where? In general what is the process of creating a new project/folder to run php and it's relation to htaccess? A link for in-depth explanation would be much appreciated.

access denied for wordpress on a local xampp

Xampp is installed on my local windows machine.
I downloaded WordPress 4.5.2, unzipped it and put the contents in a folder called wptest which is in htdocs.
Xammp has php 7.0.6
The error I am getting is:
Access forbidden!
You don't have permission to access the requested directory. There is either
no index document or the directory is read-protected.
Error 403
If I type localhost into the browser I am taken to the localhost/dashboard
and if I type in localhost/wptest I get the access denied error.
When I first copied the wp files into the wptest folder I took the following steps:
Created a DB called wptest (same as the folder with the wp files in).
Renamed wp-config-sample.php file to wp-config.php.
Inside wp-config.php I Replaced “database_name_here” with wptest,
Replaced “username_here” with “root” and Left the “password_here” blank.
I have tried several suggestions from forum posts regarding the access denied error but am getting nowhere.
As I have little experience with phpMyAdmin & XAMMP it may be a simple permissions setting I have missed.
Did you try with a older version on php?
I have the 5.6.3 version and it works fine.

PHP file not working on hosting

So this is what's happening. I don't know how to explain this.
I made a software which uploads file to my website's FTP location. It's working as it should.
As you can see in the folder that inside public_html/phphostrot.rviews.xyz/user_rot/ there are 2 php files. But when i visit the url http://phphostrot.rviews.xyz/ i get a blank page with inder of / and nothing else. And if i try to access http://phphostrot.rviews.xyz/user_rot/ I get 404 error. Even the link to the file is not working. I don't know what's the problem.
I think it's a issue with the file permissions. Have you configured your server to serve files from your public directory.
Try changing the ownership of the files to www or apache
app, img, wp-admin, wp-content, wp-includes?
check file permissions (+x), as #atefth said, check owner.
check webserver config. and check apache/nginx logs

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

Categories