Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.4.1, permissions
- This topic has 13 replies, 3 voices, and was last updated 10 years, 11 months ago by
Steven Zahm.
-
AuthorPosts
-
08/25/2015 at 12:37 pm #344298
Enrique Garibay
ParticipantHi,
We have setup plugin at,
http://www.firstpresmanhattan.com/about-us/church-directory/but its not uploading image/picture or creating directory.
its giving below error on dashboardERROR: Unable to create directory wp-content/uploads/connections-images/112-112. Is its parent directory writable by the server?
Parent directory is having 777 permission set already.
Can you please let me know what is an issue exactly, is it from server side or plugin side?
Let me know.
thanks
08/25/2015 at 2:19 pm #344307Steven Zahm
Keymaster@ Enrique
This is a server side configuration issue. WordPress is unable to to create directories because the server permissions do not permit it.
Settings the
../ wp-content/uploads/connections-images/folder to 777 could actually be the problem. Some hosts prevent that for security. I do not recommend setting it higher than 767. For a typical WordPress installation it should be 755.08/27/2015 at 3:39 am #344626Enrique Garibay
ParticipantUpdated folder permission to 767 but it doesn’t work.
I’m able to add new connections, but the image processing returns the following error log in PHP code:
[Wed Aug 26 14:04:05 2015] [error] [client 201.231.141.140] PHP Fatal error: Function name must be a string in /var/www/vhosts/firstpresmanhattan.com/httpdocs/wp-admin/includes/file.php on line 352, referer: http://www.firstpresmanhattan.com/wp-admin/admin.php?page=connections_manage&cn-action=edit_entry&id=376&_wpnonce=a4856b27b1″
that’s why the POST action returns 500
if we add a new entry with an image, the entry in the “uploads/connections-images” is created OK as expected, but the upload process aborts due to the error above
Any Idea?
Thanks
08/27/2015 at 11:44 am #344663Steven Zahm
Keymaster@ Enrique
Seems there is a bug in WordPress…
This is going to be a bit technical, bear with me.
WordPress allows custom error handlers to be used there and there are multiple ways to define the callback function for a custom error handler. One is a string and another an array. Connections defines the custom error handler using an array. There are a couple ways to run a custom error handler callback, but only one is compatible with arrays.
All other instances in the WordPress upload function call the custom error handler callback using the way that is compatible with an array… except for one. Unfortunately this is the error you are experiencing and it is triggering the fatal PHP error. I’ll report the bug to the WordPress devs.
The exact error you are experiencing, as reported by WordPress is:
“The uploaded file could not be moved to %s.”
The
%swould be the path.When Connections uploads an image the path would be this:
../wp-content/uploads/connections-images/{entry-slug}/The
{entry-slug}is created from the entry name.You said, “if we add a new entry with an image, the entry in the “uploads/connections-images” is created OK as expected”
Can you clarify this statement?
When you say it is created OK? Do you mean the
{entry-slug}folder? Or do you mean that the folder is created and the image is in it?I would expect based on the error WordPress is reporting, the folder is created, but that the image is not in it because WordPress can not verify that the file was moved correctly.
I’ve glanced over your other support topics posted in the past and it seems server permissions has been an issue. Unfortunately I am not certain what the solution would be for this, you’ll need to contact your web host to see what they suggest. Writing to the WordPress uploads folder should be non-issue and it is for nearly all web hosts so there has to be a server setting they can change for you.
This might help your host, the PHP function failing is either
move_uploaded_file()orrename(). These functions generally only fail when the folder that object is being move into does not have the write permissions for the user/group (server user/group, not WordPress user) moving the file.My guess is that when WordPress creates the
{entry-slug}folder it is not able to set correct write permissions for the server user/group. It should inherit the parent’s folder (/connections-images/) permissions and for some reason it is not.Hope that helps!
08/27/2015 at 1:43 pm #344673Enrique Garibay
GuestThank you for the prompt reply.
There does not appear to be an issue in creating the slug folder. It is being created as expected.
Meanwhile, please help us to understand what should take place when an image is uploaded. What should happen after the slug folder is created?
The image should ultimately be posted into a directory. However it is never appears to be uploaded. What directory should the image be uploaded into?
Let’s say we add a new entry “Johnson Family”. It seems that there should be a related folder created at “httpdocs/wp-content/uploads/connections-images/johnson-family” However there is no image found in that folder.
Could you help us to understand what we should expect with an uploaded file?
Thank you. Enrique.
08/27/2015 at 2:22 pm #344690Steven Zahm
Keymaster@ Enrique
The failure is happening early in the process… but here’s an overview of the process.
- Selected image is uploaded to the server temp folder with a unguessable temp file name. This is a PHP “standard” for all uploads regardless of WordPress, Connections and so on.
- WordPress validates the file, such as permitted file type, file size and safe file name.
- After validation passes, the file is moved to the destination folder. Before the file is moved…
- If the destination folder does not exist then WordPress creates it setting its permissions to that of its parent folder.
- WordPress attempts to move the file using either
move_uploaded_file()orrename(), core PHP functions (not WordPress or Connections). This is where the failure is occurring. As previously stated, very likely a server permissions configurations issue. - As part of the file being moved, it is also renamed to its final name. In this case the
{entry-slug}(johnson-family.jpg). - After it is moved successfully, then Connections get involved and creates image size variations based on the image settings on the Connections : Settings admin page under the Image tab.
As you see, Connections is only involved on the periphery of the process. It “merely” provides the HTML form to upload an image, tells WordPress to allow only image file types and where to move and name the file after it is successfully validated.
09/02/2015 at 4:29 pm #345344Enrique Garibay
GuestThis reply has been marked as private.09/02/2015 at 5:11 pm #345350Steven Zahm
Keymaster@ Enrique
Like I’ve been saying, this is very likely a server config issue with how permissions are set up something only your host will be able to solve.
That said…
I’ll take a look. I’ll need WP admin access, an FTP login and a login to the cPanel or Plesk admin. I’m not a server admin but I am competent enough I won;t break anything that I can’t fix.
09/02/2015 at 7:11 pm #345354Enrique Garibay
GuestThis reply has been marked as private.09/04/2015 at 12:05 pm #345571Steven Zahm
Keymaster@ Enrique
I was able to fix this. Your site was setup to PHP safe mode. After disabling this feature the image upload worked correctly.
There is no harm is disabling this feature. The authors of PHP actually even removed this feature in PHP 5.4. Your host is running PHP 5.3 where the feature was deprecated.
Contrary to the name of the feature it does not really make PHP safe or provide any “real” security. This is something that you web host has already taken care of the server level. You can read more about safe mode if you want in this excellent article:
https://ilia.ws/archives/18_PHPs_safe_mode_or_how_not_to_implement_security.html
Hope that helps!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
