cURL + File Permissions

TFlan

I could change this in my User CP.
Reaction score
64
Example directory tree:
Code:
root
   |-- images/
   |-- includes/
   |-- scripts/
   |-  index.php
   |-  index_template.html

Now I have a template system located in the 'includes' folder, which uses the cURL function to grab the template in the root directory.

Now my question is, what file permissions are needed for this to function properly?

I'm guessing 755 minimum.

My problem is for some reason the server I'm currently working on is set up to have 644 for 'others'. I've tried to change it myself to 755 via Properties -> Security and FTP programs, but the server automatically resets the permissions back to 644 after any change.

Edit::
I've also tried changing it via chmod().
 

Samuraid

Advisor
Reaction score
81
Why are you using cURL? Assuming both the script and the HTML file are physically on the same server, you should use file_get_contents instead. And use the real file path, not the URL to the file.

Example, as if you had a script called includes/template.php:
PHP:
$html_data = file_get_contents(__FILE__ . '/../index_template.html');
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top