We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question, Problem, Forms

Problem with Perch Form with Uploads

Hi,

I have a number of Perch forms running on a new website.

I notice that in the 'stored' responses in admin, when I click on the response and then click the uploaded file name it does not download. It just reloads the page with the url: http://www.clients-website.co.uk/perch/addons/apps/perch_forms/responses/detail/?id=47&file=cv

The uploaded files are correctly being stored in a folder outside the root: /home/sites/clients-website.co.uk/uploads

SUMMARY INFORMATION

Perch: 2.8.32, PHP: 7.0.12, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_blog (5.0), form_builder (1), perch_forms (1.8.3)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'form_builder', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/sites/butler-taylor.co.uk/public_html/perch
PERCH_CORE: /home/sites/butler-taylor.co.uk/public_html/perch/core
PERCH_RESFILEPATH: /home/sites/butler-taylor.co.uk/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 48M, Max POST 48M, Memory: 256M, Total max file upload: 48M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: www.butler-taylor.co.uk
DOCUMENT_ROOT: /home/sites/butler-taylor.co.uk/public_html
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Simon Clay

Simon Clay 127 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you see anything that might relate in your error log?

What do the file permissions on the uploaded files look like?

Simon Clay

Simon Clay 127 points

The uploaded files have 644 permissions. The upload folder has 755.

There are a lot of errors in these three flavours:

butler-taylor.co.uk [Mon Nov 21 11:41:46 2016] [error] [client 81.136.248.178:40264] AH01215: PHP Notice:  Array to string conversion in /home/sites/butler-taylor.co.uk/public_html/perch/addons/apps/perch_forms/modes/response.detail.pre.php on line 18: /home/sites/butler-taylor.co.uk/public_html/perch/addons/apps/perch_forms/responses/detail/index.php

butler-taylor.co.uk [Mon Nov 21 11:41:46 2016] [error] [client 81.136.248.178:40264] AH01215: PHP Notice:  Undefined property: stdClass::$Array in /home/sites/butler-taylor.co.uk/public_html/perch/addons/apps/perch_forms/modes/response.detail.pre.php on line 18: /home/sites/butler-taylor.co.uk/public_html/perch/addons/apps/perch_forms/responses/detail/index.php

butler-taylor.co.uk [Mon Nov 21 11:41:46 2016] [error] [client 81.136.248.178:40264] AH01215: PHP Notice:  Trying to get property of non-object in /home/sites/butler-taylor.co.uk/public_html/perch/addons/apps/perch_forms/modes/response.detail.pre.php on line 20: /home/sites/butler-taylor.co.uk/public_html/perch/addons/apps/perch_forms/responses/detail/index.php
Drew McLellan

Drew McLellan 2638 points
Perch Support

So the responses are received and stored, and the file is uploaded, it just isn't accessible?

Simon Clay

Simon Clay 127 points

That's correct, the file is being uploaded but isn't accessible.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Simon Clay

Simon Clay 127 points

Sorry, how do I discover that?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Just in your browser dev tools, Network tab.

Simon Clay

Simon Clay 127 points

Thanks, they all show as 200

headers

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. Is it working in dev?

Simon Clay

Simon Clay 127 points

Hi, yes it is working in local dev

LOCAL DEV 

SUMMARY INFORMATION

Perch: 2.8.32, PHP: 5.6.10, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_blog (5.0), form_builder (1), perch_forms (1.8.3)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'form_builder', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/simonclay/Dropbox/Clients/Butler Taylor/Butler Taylor Web Folder/perch
PERCH_CORE: /Users/simonclay/Dropbox/Clients/Butler Taylor/Butler Taylor Web Folder/perch/core
PERCH_RESFILEPATH: /Users/simonclay/Dropbox/Clients/Butler Taylor/Butler Taylor Web Folder/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: bt:8888
DOCUMENT_ROOT: /Users/simonclay/Dropbox/Clients/Butler Taylor/Butler Taylor Web Folder
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Simon Clay

Simon Clay 127 points

Hi, the difference I spotted between the two summaries is the PHP version. I wound back from PHP7 to PHP5.6 and the functionality worked as expected straight away.

So, some PHP7 issue there I guess?

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's unlikely - probably the more likely issue is a difference in configuration between your two PHP versions. They'll use different php.ini files.

Simon Clay

Simon Clay 127 points

Ok. It still means I need to steer clear of PHP7 sadly, until I can work out what needs changing. I placed a php.ini file in the root to up the memory etc. But do not know what to ask the hosting provider to change about the PHP configuration.

memory_limit = 256M
upload_max_filesize = 48M
post_max_size = 48M
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you able to compare the two?

Simon Clay

Simon Clay 127 points

: : : Dumb question alert : : :

Would you do that by placing a phpinfo file on each server and trying to spot the difference?

Drew McLellan

Drew McLellan 2638 points
Perch Support

That would be the hard way, but is possible. Do you have access to the php.ini file?

Simon Clay

Simon Clay 127 points

After much discussion with the hosts, it's not possible to access the php.ini file.

The best I have is the phpinfo for each of the PHP5.6 and PHP7 servers

PHP5.6

PHP7

I have a clever bit of software to show the differences between these two files, but they are long pages and I'm not sure what I'm looking for.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, let me know if I can help.

Simon Clay

Simon Clay 127 points

Thanks very much Drew. I will filter out all the differences and see what we get.

Simon Clay

Simon Clay 127 points

Hi, as a couple of other people on the forum, I am still having issues with downloading files from Perch Form responses in PHP7, in both development (mamp) and production (shared hosting) environments. I have reluctantly wound production back to 5.6.

In development, the files download as expected under PHP 5.6, but on PHP7 I receive the following errors:

Notice: Array to string conversion in /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/addons/apps/perch_forms/modes/response.detail.pre.php on line 18

Notice: Undefined property: stdClass::$Array in /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/addons/apps/perch_forms/modes/response.detail.pre.php on line 18

Notice: Trying to get property of non-object in /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/addons/apps/perch_forms/modes/response.detail.pre.php on line 20

Warning: Cannot modify header information - headers already sent by (output started at /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/addons/apps/perch_forms/modes/response.detail.pre.php:18) in /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/core/lib/PerchUtil.class.php on line 1211

Warning: Cannot modify header information - headers already sent by (output started at /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/addons/apps/perch_forms/modes/response.detail.pre.php:18) in /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/core/lib/PerchUtil.class.php on line 1212

Warning: Cannot modify header information - headers already sent by (output started at /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/addons/apps/perch_forms/modes/response.detail.pre.php:18) in /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/core/lib/PerchUtil.class.php on line 1213

Warning: Cannot modify header information - headers already sent by (output started at /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/addons/apps/perch_forms/modes/response.detail.pre.php:18) in /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/core/lib/PerchUtil.class.php on line 1219

Warning: Cannot modify header information - headers already sent by (output started at /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/addons/apps/perch_forms/modes/response.detail.pre.php:18) in /Users/simonclay/Dropbox/Clients/Lowe Build/Sips Runway/perch/core/inc/top.php on line 17