PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, March 1, 2022

[FIXED] Linux Hosting files outside the htdocs directory

 March 01, 2022     directory, lamp, lampp, linux, xampp     No comments   

Issue

I followed this instructions to be able to host files outside of the htdocs directory, but I alwyas get 'Access Forbidden' (https://gyazo.com/af49cb00720fa4bd80e969320bd51042).

The file those permissions: $ ls -l ~/Documents/code/xampp/ total 4 -rw-r--r-- 1 julian users 3337 Apr 10 2017 test.php How do i fix this issue ?


Solution

Aache is not able to execute the php file, because apache don't have permission to execute the test.php file.

Try giving permission to the file.

sudo chmod +x test.php

Any user can execute the file.So change the file group to www-data and give executable permission.

sudo chown root:www-data test.php

sudo chmod 775 test.php



Answered By - Ram
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing