Question

I am new to Drupal, so please bare with me. I have a Drupal site that is working fine. Now what I want to do is allow access to folder which contains some custom php script.

I tried to put the folder in the /sites/default/files/ but it didn't work. I found a question on it Extending Drupal Functionality to Custom PHP Page but not able to add Drupal functionality on this page. I just want to access that folder and its content.

So please any help would be appreciated. Thanks

Was it helpful?

Solution

The default path or root directory of any Drupal site is the same directory/folder which contains the site itself. ie. Same directory which houses the "sites" directory. If I put a php file there called "my_code.php", any reference to the file will be seen by everything as default. Its when other directories are created and the file placed there which make a file's location more specfic. So if I'm in a php file in another directory and I put in a statement like:

include 'my_code.php';

Drupal will start by looking in its default root directory. If I create a directory there called "my_php_files" and put the "my_code.php" file inside, then my reference to include that file would be:

include 'my_php_files/my_code.php';

Default permissions are normally 755 for directories and 644 for files.

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top