Forum

Thread tagged as: Problem, Error

Issues With Adding PDF assets

I am running Perch 2.7.2 and previously was able to add a link to a file in a template by choosing the asset like any other. However since updating I cannot seem to get it to work.

So I click of the file link this brings up the asset manager and I add a file as usual by locating it locally and adding it. It goes through the upload procedure then the spinner just spins and nothing gets added.

It looks like its trying to create a preview? Any ideas

Code for file is

<perch:content id="file" type="file" label="File" />
Nigel Coath

Nigel Coath 1 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can we see your Diagnostics Report?

Here it is:

PERCH INFORMATION

Perch: 2.7.2
Production mode: Production (100)
Installed apps: content (2.7.2), assets (2.7.2), categories (2.7.2), perch_forms (1.8), perch_blog (4.1), perch_members (1.0.3), perch_backup (1.2)
DB driver: PDO
DB tables: perch2_blog_authors, perch2_blog_categories, perch2_blog_comments, perch2_blog_posts, perch2_blog_posts_to_categories, perch2_blog_posts_to_tags, perch2_blog_sections, perch2_blog_tags, perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_forms, perch2_forms_responses, perch2_members, perch2_members_forms, perch2_members_member_tags, perch2_members_sessions, perch2_members_tags, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 1
App runtimes:
<?php
    include(PERCH_PATH.'/core/apps/content/runtime.php');
    include(PERCH_PATH.'/addons/apps/perch_blog/runtime.php');
    include(PERCH_PATH.'/addons/apps/perch_forms/runtime.php');
    include(PERCH_PATH.'/addons/apps/perch_members/runtime.php');
?>
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup
H1: e4552df7237f05bdc0559d932cb0daff
L1: a6034e2bc1acb80bf4627925788ed9db
headerColour: #FFF
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 0
lang: en-gb
update_2.4.5: done
latest_version: 2.5.3
on_sale_version: 2.7.2
headerScheme: light
dashboard: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_blog_post_url: /news/{postSlug}
perch_blog_update: 4.0
perch_members_login_page: /members/login.php?r={returnURL}
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_max_spam_days: 0
perch_backup_mysqldump_path:
perch_blog_comment_notify: 0
logoPath: /admin/resources/1414772327_logo.png
update_2.4.6: done
update_2.4.9: done
hide_pwd_reset: 0
perch_blog_akismet_key: c95ada07b951
update_2.5.3: done
update_2.6: done
update_2.6.3: done
update_2.6.6: done
update_2.7: done
update_2.7.2: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: stratfordadmin
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: stratford-cms
PERCH_DB_PREFIX: perch2_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: nigel@marketingalchemy.co.uk
PERCH_EMAIL_FROM_NAME: Nigel Coath
PERCH_LOGINPATH: /admin
PERCH_PATH: /var/www/vhosts/marketingalchemy.co.uk/stratfordhouse.marketingalchemy.co.uk/admin
PERCH_CORE: /var/www/vhosts/marketingalchemy.co.uk/stratfordhouse.marketingalchemy.co.uk/admin/core
PERCH_RESFILEPATH: /var/www/vhosts/marketingalchemy.co.uk/stratfordhouse.marketingalchemy.co.uk/admin/resources
PERCH_RESPATH: /admin/resources
PERCH_HTML5: 1
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /var/www/vhosts/marketingalchemy.co.uk/stratfordhouse.marketingalchemy.co.uk/admin/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS

PHP: 5.4.33
Zend: 2.4.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: 5.0.90
MySQL server: 5.5.38-cll-lve
Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bz2, calendar, ctype, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, sockets, mbstring, tokenizer, xml, cgi-fcgi, imagick, curl, dom, fileinfo, gd, imap, json, exif, mysql, mysqli, PDO, pdo_mysql, pdo_sqlite, Phar, wddx, xmlreader, xmlwriter, xsl, zip, mhash, ionCube Loader
GD: Yes
ImageMagick: Yes
PHP max upload size: 128M
PHP max form post size: 8M
PHP memory limit: 128M
Total max uploadable file size: 8M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
PATH: /sbin:/usr/sbin:/bin:/usr/bin
PP_CUSTOM_PHP_INI: /var/www/vhosts/system/stratfordhouse.marketingalchemy.co.uk/etc/php.ini
PP_CUSTOM_PHP_CGI_INDEX: fastcgi
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
REQUEST_URI: /admin/core/settings/diagnostics/?extended
QUERY_STRING: extended
REQUEST_METHOD: GET
SERVER_PROTOCOL: HTTP/1.1
GATEWAY_INTERFACE: CGI/1.1
REMOTE_PORT: 57919
SCRIPT_FILENAME: /var/www/vhosts/marketingalchemy.co.uk/stratfordhouse.marketingalchemy.co.uk/admin/core/settings/diagnostics/index.php
SERVER_ADMIN: nigel@procreative.co.uk
DOCUMENT_ROOT: /var/www/vhosts/marketingalchemy.co.uk/stratfordhouse.marketingalchemy.co.uk
REMOTE_ADDR: 178.16.227.115
SERVER_PORT: 80
SERVER_ADDR: 62.249.245.12
SERVER_NAME: stratfordhouse.marketingalchemy.co.uk
SERVER_SOFTWARE: Apache
SERVER_SIGNATURE: <address>Apache Server at stratfordhouse.marketingalchemy.co.uk Port 80</address>
HTTP_CONNECTION: close
HTTP_COOKIE: cmsa=1; PHPSESSID=9kj35c3ikqg0cpfje6rnh2lfj2; cmssb=0
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_DNT: 1
HTTP_REFERER: https://stratfordhouse.marketingalchemy.co.uk/admin/core/settings/diagnostics/
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/6.1.3 Safari/537.75.14
HTTP_HOST: stratfordhouse.marketingalchemy.co.uk
UNIQUE_ID: ZUpkGj759QwAAGgQeXcAAAAI
FCGI_ROLE: RESPONDER
PHP_SELF: /admin/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1414772516.6477
REQUEST_TIME: 1414772516

I think something strange is going on, we have 3 sister sites using the same files, all running 2.7.2 all on same host. One seems to have little graphics by the assets menus the others do not.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That could be not having the SVG mime type configured on your server.

Are you getting anything logged in your server error log?

Only a server misconfiguration error. I have tried reloading the Perch files from scratch.

When I created this version I exported the sql file from the other and changed the config and user details to the new one. Everything seems to load okay except the issue with PDFs.

I also notice the problematic site does not seem to have little graphics by the assets menus.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you looked at the SVG mime type as I suggested?

Could this be related to the issue I reported with PDF preview images?

https://forum.grabaperch.com/forum/10-27-2014-assets-preview-image-not-showing

I have checked and I do have SVG mime type configured on my server.

Still struggling with this. I suspect its a server issue but having a hard time getting my ISP to extract any meaningful error logs.

Can you explain why adding an svg mime type would help for a pdf? Surely thats for png etc?

Can you also explain what I need on the server to get PDF previews on uploads as on my other server that works with pdf uploads the preview is a ? mark.

I have GD and Imagick installed (on both servers).

Its like pulling teeth confirming what is/is not installed so a list of recommended elements would be useful.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Leave it with me and I'll look at it after the weekend.

Okay thanks. FYI here are two sample errors generated after trying to add a PDF:

[Sat Nov 01 15:10:16 2014] [warn] [client 86.172.87.85] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: https://stratfordhouse.marketingalchemy.co.uk/admin/core/apps/assets/edit/

[Sat Nov 01 15:10:16 2014] [error] [client 86.172.87.85] Premature end of script headers: index.php, referer: https://stratfordhouse.marketingalchemy.co.uk/admin/core/apps/assets/edit/

Okay I got my ISP to move me to a different server and now I can upload PDFs, now its not a deal breaker but I cannot get a preview for a PDF asset, should I be able to see one and whats missing to stop this?

I have both Imagick and GD on the server.

Drew McLellan

Drew McLellan 2638 points
Perch Support

This will be fixed in 2.7.3.