XF 1.5 not able to upload images and files / PHP 7.0

erich37

Well-known member
I have just upgraded my hosting-server towards PHP 7.0.x and MySQL 5.7
I am running the latest XF-version 1.5.16a


Issue:
I am creating a new user via ACP, then I am uploading an avatar-image (size: 10 kB) for that user.
The issue is that the Avatar-image is not showing at all.



It seems this is because I upgraded to PHP 7.0.x, because there is not anything else which has been changed.
Any advice as to why the Avatar-image is not showing anymore when creating new users and how to fix this ?

Many thanks for help!
 
I have just upgraded my hosting-server towards PHP 7.0.x and MySQL 5.7
I am running the latest XF-version 1.5.16a


Issue:
I am creating a new user via ACP, then I am uploading an avatar-image (size: 10 kB) for that user.
The issue is that the Avatar-image is not showing at all.



It seems this is because I upgraded to PHP 7.0.x, because there is not anything else which has been changed.
Any advice as to why the Avatar-image is not showing anymore when creating new users and how to fix this ?

Many thanks for help!

Do you have GD or ImageMagick installed on your server?
 
just so you know XF is now latest as 2.0.0 and that 1.5.16a is no longer latest XF.

about GD and ImageMagick, you only need 1 of these either GD extension module for php or ImageMagick. create a file named temp.php and add this code inside it.
PHP:
<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>

then browse to it via your domain like example.com/temp.php then you will get a full information page, use search box from your browser such as ctrl + f and type GD if it takes you to 1 spot with GD as bold then your server has GD.
 
I have tried to upload a small txt/non-image file as an attachment to a Forum-thread. This also does not work.

Does this mean, there is an incorrect file permission-setting somewhere ?
 
I have tried to upload a small txt/non-image file as an attachment to a Forum-thread. This also does not work.

Does this mean, there is an incorrect file permission-setting somewhere ?
it means probably you don't have GD installed, did you check php info as I wrote above?, if not then please do so to be sure GD is installed.
 
I just checked with my hosting-provider:

- they are saying that both GD and ImageMagick is installed.
- they are saying that for "ImageMagick" I need to set PHP as "CGI-Module" instead as "Apache Module" (which I am using now).

I have used PHP as "Apache Module" before upgrading to PHP 7.0.x, and everything was working fine previously.


General question:
Is GD or ImageMagick required, in order to run XenForo 1.5.16a ?
 
Turns out, the issue was that I have set PHP 7.0.x as "Apache Module".
When I set PHP 7.0.x as "CGI Module", then the file-upload works fine.



Likely the issue was some wrong permission-settings.


:eek:
 
Last edited:
this is the Error-message I got in the ACP:





Code:
Fehlerinformation

ErrorException: copy(/www/htdocs/w0815z/internal_data/attachments/0/36-fd5af430bfd81fe2df1e817dae4f5a6c.data): failed to open stream: Permission denied - library/XenForo/Helper/File.php:261


Stapelverfolgung

#0 [internal function]: XenForo_Application::handlePhpError(2, 'copy(/www/htdoc...', '/www/htdocs/w08...', 261, Array)

#1 /www/htdocs/w0815z/library/XenForo/Helper/File.php(261): copy('/tmp/php7RTvsH', '/www/htdocs/w08...')

#2 /www/htdocs/w0815z/library/XenForo/DataWriter/AttachmentData.php(265): XenForo_Helper_File::safeRename('/tmp/php7RTvsH', '/www/htdocs/w08...')

#3 /www/htdocs/w0815z/library/XenForo/DataWriter/AttachmentData.php(224): XenForo_DataWriter_AttachmentData->_moveFile('/tmp/php7RTvsH', '/www/htdocs/w08...')

#4 /www/htdocs/w0815z/library/XenForo/DataWriter/AttachmentData.php(144): XenForo_DataWriter_AttachmentData->_writeAttachmentFile('/tmp/php7RTvsH', Array)

#5 /www/htdocs/w0815z/library/XenForo/DataWriter.php(1423): XenForo_DataWriter_AttachmentData->_postSave()

#6 /www/htdocs/w0815z/library/XenForo/Model/Attachment.php(539): XenForo_DataWriter->save()

#7 /www/htdocs/w0815z/library/XenForo/ControllerPublic/Attachment.php(205): XenForo_Model_Attachment->insertUploadedAttachmentData(Object(XenForo_Upload), 1)

#8 /www/htdocs/w0815z/library/XenForo/FrontController.php(369): XenForo_ControllerPublic_Attachment->actionDoUpload()

#9 /www/htdocs/w0815z/library/XenForo/FrontController.php(152): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))

#10 /www/htdocs/w0815z/index.php(13): XenForo_FrontController->run()

#11 {main}


Benötigter Status array(3) {

["url"] => string(110) "http://www.domain.com/attachments/do-upload.json?hash=0c112ebd7fe25016bcb5f92d7026f0d3&content_type=post"

["_GET"] => array(2) {

["hash"] => string(32) "0c112ebd7fe25016bcb5f92d7026f0d3"

["content_type"] => string(4) "post"

}

["_POST"] => array(13) {

["_xfToken"] => string(8) "********"

["_xfNoRedirect"] => string(1) "1"

["_xfResponseType"] => string(4) "json"

["_xfSessionId"] => string(32) "953627c2332f50a0d8345ec83514de78"

["content_data"] => array(1) {

["node_id"] => string(3) "125"

}

["flowChunkNumber"] => string(1) "1"

["flowChunkSize"] => string(10) "4294967296"

["flowCurrentChunkSize"] => string(2) "62"

["flowTotalSize"] => string(2) "62"

["flowIdentifier"] => string(14) "62-hinblicktxt"

["flowFilename"] => string(12) "hinblick.txt"

["flowRelativePath"] => string(12) "hinblick.txt"

["flowTotalChunks"] => string(1) "1"

}

}


----------------------------------------------------------




Turns out, the issue was that I have set PHP 7.0.x as "Apache Module".
When I set PHP 7.0.x as "CGI Module", then the file-upload works fine.



Question:
are you running PHP as "CGI-Module" at your Forums ?
I was under the impression that "PHP Apache Module" is the correct setting.....


:eek:
I'm using 5.6.x still since I'm waiting for forums like this and many more are compatible with 7.0 and up before I upgrade. I do have PHP version switch thanks to cpanel/whm :) so all I gota do is switch to version I want and whenever I want.
 
you are a bit behind xD xf 2.0.0 is newest now :p
But XF 2.0 does not have all the equivalent add-ons that are available for the 1.X line... in my case 2 very big ones are not currently updated - and they were an integral part of the site.... so upgrading to 2.0 just to "be on the newest version" would be sheer stupidity for me (and many others that are dependent upon add-ons that are not currently 2.0 compatible).
 
Top Bottom