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

how can i connect my laravel server?
How to get data which is not empty in cakephp
php multidimensional array foreach
Multi dimensional array merge using php
Decode UTF-8 exported XML nodes (Persian) by PHP
Regex to find string independently or attached with tags php
Why this function always returning false?
Redirection with Header(Location:) is not working when image is uploaded with dropjoneJS
PHP form in AJAX no return
echo pre-defined names in main index [closed]
Error when attempting to get XML data
Smarty shows errors from compiled files
Behavior of number_format() across 5.3 & 5.4
How to remove an array element from an array by length
Splitting strings through php to query mysql
mysql to mysqli change, trouble with mysqli_real_escape_string

Categories

HOME
orientdb
webview
android-espresso
angular-ui-grid
yahoo-weather-api
swi-prolog
add-on
windows-10
ews
website
adobe
openlayers-3
biztalk
informatica
moodle-api
linker
firebase-database
graphql-js
tweepy
cocotb
mutation-testing
azure-graph-api
match
jqxgrid
varnish-vcl
codefluent
pfobject
angular2-highcharts
tableview
kamailio
kaggle
altium-designer
candlestick-chart
chronicle-queue
vuforia
opentext
tracing
basex
spring-annotations
cube
boolean-logic
sales
bitbake
amazon-iam
tightvnc
netbios
osx-lion
transform
dreamfactory
jade4j
oauth2
hdiv
angular-datatables
web-inspector
git-tfs
doctrine-extensions
react-intl
section508
.net-micro-framework
roracle
android-5.0-lollipop
ol3-google-maps
entropy
pecl
d3v4
petsc
java-2d
mathjs
clp
coovachilli
static-methods
timestamping
taco
phpquery
google-maps-api-2
dsa
android-studio-import
wlanapi
android-handler
unidata
console.log
camus
mxe
r.java-file
jcheckbox
encryption-symmetric
flurry-analytics
back
angular-ui-select
windows-messages
two.js
thruway
sql-function
xmi
boolean-algebra
ctp
eclim
illuminate-container
coalesce
blobstorage
dibs
mongo-jackson-mapper
examine
ckeditor.net
nsmutablestring
clrprofiler
sfinae
exponent
uploading
affinetransform
fork-join
azure-acs
css-friendly
gaelyk
eaccelerator
ixmldomdocument
j2mepolish
getimagesize
eventaggregator
mysqli-multi-query
3270
data-retrieval
.net-client-profile
rtti

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App