php


file_put_contents permission denied causing error writing to file


I have a text file with chmod 777 in some directory: /a/b/example.txt
I have a php script in another directory: /c/d/script.php
Calling file_put_contents in the php script gives a permission error. The file, example.txt has chmod 777 and all its parent directories have 700 or 775. I believe executable permissions should be enough for the parents.
This is the error message I get:
Warning: file_put_contents(/home/a/b/example.txt): failed to open stream: Permission denied in /home/c/d/script.php on line 103 Error writing to example.txt
I have looked around but haven't found a working solution. Hoping for some further suggestions of things to try.

Related Links

What is the non-casted variables in the SQL? [Prestashop]
get powershell script output by running it with PHP
Write multiple files in parallel with php from the same browser
Calculate values of deep nested multi dimensional arrays in reverse
Using php preg_replace to remove some punctuations from utf-8 encoded string [duplicate]
Server redirection in .htaccess changing with the order of RewriteRule statements
CSV file line count not working in PHP
Handle Laravel 5.3 QueryException?
Explode based on special characters
How to add model variable to another model in Laravel
Wordpress theme mods api and update
How do you enable multithreading on nginx and apache
How to sort an array from linear distribution to normal distribution in PHP?
How to convert a PHP DOMElement into a PHP DOMNodeList
Why i cannot set my db table with a code one by one in php?
how to pass custom fields to $_POST or $_GET in CKEdtior Upload dialog?

Categories

HOME
azure-functions
opencart
verification
antd
activemq
ios-simulator
android-emulator
informatica
autocomplete
gentelella
navigation
google-search-console
polymer-2.x
bootstrap-switch
mailmerge
createjs
mailgun
maven-surefire-plugin
stackexchange.redis
pymongo
backendless
jstree
cellular-network
fstar
sparkle
nic
instructions
netbios
quick-nimble
om-next
djcelery
uivisualeffectview
assert
selenide
windows-store
grunt-contrib-watch
slideshow
plane
system-on-chip
grails3.2.0
opal-framework
raytracing
word-cloud
music21
deedle
test-data
kendo-editor
predicates
dynamics-crm-4
ltrace
adobe-reader
fitbit
oid
annotatorjs
yargs
libharu
django-testing
between
ajax4jsf
apple
roxygen2
tree-structure
subfolder
scala-swing
text-align
mathematical-expressions
html-escape-characters
tkx
mojo
jcheckbox
thoughtworks-go
dnsjava
nachos
meteor-collections
radius-protocol
usb-flash-drive
spring-social-linkedin
windows-taskbar
django-settings
revmob
sly-scroller
examine
jquery-dialog
clrprofiler
nsfont
yuidoc
delphi-prism
datacontracts
server-variables
vows
cewolf
upshot
photo-management
channelfactory
active-record-query
hungarian-notation
oracle-pro-c
external-sorting
rtti
activex-exe

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App