61014

Permission denied on getimagesize

In my functions.php I got:

$size = getimagesize($avatarpath . "/" . $file);

$avatarpath is $avatarpath = dirname(__FILE__)."/img/avatars";

My structure:

functions.php (in the same directory as img folder). img/avatars

Chmods of functions.php , img, avatars has been set to 777.

And I still receive the following message:

Warning: getimagesize(/home/godaddy/private_html/img/avatars/avatar_1.png): failed to open stream: Permission denied in /home/godaddy/private_html/img/avatars/functions.php on line 1337

Answer1:

Check the user that php runs under. If you're with godaddy, they use virtual servers so your php user may not actually have access even if you've chmod'd it. Find out the user, then chown it to that user and see if it helps.

Recommend

  • Opencart fopen(/upload/system/logs/): failed to open stream: Is a directory
  • fopen doesn´t work with something different than r php
  • PHP Files are not moving from /tmp
  • Run wkhtmltopdf on CentOS 5.5 32bit
  • Firebase, only get new children
  • Parse Framework with Swift
  • Can my app be notified when another application starts/stops playing audio?
  • Multiple Left Join LINQ-to-entities
  • read values from form post in jquery or javascript
  • Installing Perl6 and Panda on Ubuntu 15.10. Problems with bootstrap.pl
  • apply a javascript function to draggable copy
  • Can my PDF ping my server when it is opened?
  • Consuming a WCF service in a Java Client using wsHttpBinding
  • Sensibility of combined Maven/Ant+Ivy build management for dual platform Desktop/Android deployment?
  • Exception gevent.hub.LoopExit: LoopExit('This operation would block forever',)
  • Bootstrap (v3.3.4) glyphicons not displayed in IE when refresh page (F5)
  • Pycharm: Marking a folder as 'sources root' is not recursive for subfolders
  • Web.config system.webserver errors
  • How solve “Qt: Untested Windows version 10.0 detected!”
  • C: Incompatible pointer type initializing
  • Retrieve list of sent friend requests from friend_request FQL table
  • Android full screen on only one activity?
  • Checking free space on FTP server
  • Change Inet root folder for iis 7
  • NHibernate Validation Localization with S#arp Architecture
  • Paperclip, set path outside of rails root folder
  • How can I send an e-mail from a vbs script
  • Accessing IRQ description array within a module and displaying action names
  • Updated Ionic CLI but shows previous version (Windows)
  • Function pointer “assignment from incompatible pointer type” only when using vararg ellipsis
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • Proper folder structure for lots of source files
  • Load html files in TinyMce
  • How to set the response of a form post action to a iframe source?
  • Getting Messege Twice Using IMvxMessenger
  • Change div Background jquery
  • Qt: Run a script BEFORE make
  • Append folder name and increment by 1 using batch script
  • reshape alternating columns in less time and using less memory
  • Unable to use reactive element in my shiny app