Forum

Thread tagged as: Problem, Error

Pages created through Perch have incorrect URL

Hello,

New pages created through Perch are being shown in the UI with an incorrect URL. The pages exist in the right place, but the page dies when viewed.

URLs look like this: /what-we-do/job-evaluation-trainingC:/xampp/htdocs/beamans/what-we-do/job-evaluation-training/jegs-practitioner-training.php

In this instance, the correct URL should be: /what-we-do/job-evaluation-training/jegs-practitioner-training.php

Seems to be a problem with pages more than two levels deep, e.g. Site root (OK) > Level 1 (OK) > Level 2 (OK) > Level three (page problem).

When viewed, the page shows: Warning: include(......\perch\templates\pages\service_offering.php): failed to open stream: No such file or directory in C:\xampp\htdocs\beamans\what-we-do\job-evaluation-training\jegs-evaluation.php on line 1

Warning: include(): Failed opening '......\perch\templates\pages\service_offering.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\beamans\what-we-do\job-evaluation-training\jegs-evaluation.php on line 1

Editing the URL within Perch does not fix the error when displaying the page.

Problem found in Perch 2.5.4, and exists in 2.6.0 too.

Thanks, Jon

Jonathan Brain

Jonathan Brain 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show me your diagnostics report?

Health check

Ahead of the curve! You are running a pre-release version of Perch.
PHP 5.4.22 is up to date
MySQL 5.5.34 is up to date
Image processing available

Summary information

Perch: 2.6, PHP: 5.4.22, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (2.6), assets (2.6), categories (2.6)
App runtimes: <?php $apps_list = array( 'content', );
PERCH_LOGINPATH: /perch
PERCH_PATH: C:\xampp\htdocs\beamans\perch
PERCH_CORE: C:\xampp\htdocs\beamans\perch\core
PERCH_RESFILEPATH: C:\xampp\htdocs\beamans\perch\resources
Image manipulation: GD
PHP limits: Max upload 8M, Max POST 12M, Memory: 128M, Total max file upload: 8M
Resource folder writeable: Yes
HTTP_HOST: beamans
DOCUMENT_ROOT: C:/xampp/htdocs/beamans
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Perch information

Perch: 2.6
Production mode: Production (100)
Installed apps: content (2.6), assets (2.6), categories (2.6)
DB driver: PDO
DB tables: perch2_categories, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, 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
    $apps_list = array(
        'content', 
    );

Editor plug-ins: markitup
H1: 70fcfea414e083906d317d5777a69d29
L1: c31fab3ad0fdbc6fe6dda492b5bcb6eb
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.5.4: done
latest_version: 2.5.3
on_sale_version: 2.5.4
update_2.6: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: local
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: beamans
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/London
PERCH_EMAIL_FROM: jon@jonathanbrain.com
PERCH_EMAIL_FROM_NAME: Jon Brain
PERCH_LOGINPATH: /perch
PERCH_PATH: C:\xampp\htdocs\beamans\perch
PERCH_CORE: C:\xampp\htdocs\beamans\perch\core
PERCH_RESFILEPATH: C:\xampp\htdocs\beamans\perch\resources
PERCH_RESPATH: /perch/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: C:\xampp\htdocs\beamans\perch\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.22
Zend: 2.4.0
OS: WINNT
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
MySQL server: 5.5.34
Extensions: Core, bcmath, calendar, ctype, date, ereg, filter, ftp, hash, iconv, json, mcrypt, SPL, odbc, pcre, Reflection, session, standard, mysqlnd, tokenizer, zip, zlib, libxml, dom, PDO, bz2, SimpleXML, wddx, xml, xmlreader, xmlwriter, apache2handler, openssl, curl, mbstring, exif, gd, gettext, mysql, mysqli, Phar, pdo_mysql, pdo_sqlite, soap, sockets, sqlite3, xmlrpc, xsl, mhash
GD: Yes
ImageMagick: No
PHP max upload size: 8M
PHP max form post size: 12M
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
MIBDIRS: C:/xampp/php/extras/mibs
MYSQL_HOME: \xampp\mysql\bin
OPENSSL_CONF: C:/xampp/apache/bin/openssl.cnf
PHP_PEAR_SYSCONF_DIR: \xampp\php
PHPRC: \xampp\php
TMP: \xampp\tmp
HTTP_HOST: beamans
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.5
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_REFERER: https://beamans/perch/core/settings/diagnostics/
HTTP_COOKIE: PHPSESSID=n0bbj9jc66ii1qj44jbuf45d21; cmsa=1; __utma=11671975.1374267527.1408022726.1408109976.1408115207.4; __utmc=11671975; __utmz=11671975.1408022726.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=11671975.0.10.1408115207
HTTP_CONNECTION: keep-alive
PATH: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft\Web Platform Installer\;c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;
SystemRoot: C:\WINDOWS
COMSPEC: C:\WINDOWS\system32\cmd.exe
PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR: C:\WINDOWS
SERVER_SIGNATURE: <address>Apache/2.4.7 (Win32) OpenSSL/0.9.8y PHP/5.4.22 Server at beamans Port 80</address>
SERVER_SOFTWARE: Apache/2.4.7 (Win32) OpenSSL/0.9.8y PHP/5.4.22
SERVER_NAME: beamans
SERVER_ADDR: 127.0.0.1
SERVER_PORT: 80
REMOTE_ADDR: 127.0.0.1
DOCUMENT_ROOT: C:/xampp/htdocs/beamans
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: C:/xampp/htdocs/beamans
SERVER_ADMIN: postmaster@localhost
SCRIPT_FILENAME: C:/xampp/htdocs/beamans/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 63569
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1408118239.789
REQUEST_TIME: 1408118239
Drew McLellan

Drew McLellan 2638 points
Perch Support

When did this start?

During site development today. I don't use the Pages functionality much, and this is the first time I've noticed this problem.

Drew McLellan

Drew McLellan 2638 points
Perch Support

But it was working fine previously?

I've not used Perch this way before, that would have to be a "don't know", I'm afraid.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. Presumably this isn't the production server?

That's correct. It's a new site in the early stages of development.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I think it must be something to do with the environment. I'm unsure as to why you have paths like this:

C:/xampp/htdocs/beamans

I'd expect that to be more like this on Windows:

C:\xampp\htdocs\beamans

I see. I checked my Apache (XAMPP) config, and the document root for this site is set up using the Windows backslashes (as below). Apache is seems to be converting the path to a UNIX-style one.

<VirtualHost beamans>
DocumentRoot "C:\xampp\htdocs\beamans"
ServerName beamans
</VirtualHost>

I don't know if this is a standard thing for Apache on Windows, or whether it's simply a feature of this version of XAMPP or PHP. I have had problems previously with slashes in Perch on Windows (multiple versions of Windows/XAMPP/PHP - see my previous support tickets), but these have been resolved when moved to production because the production server is inevitably a flavour of UNIX.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, I see. I don't know if that's the source of your issue, but it's a possibility. As you'll have gathered, cross-server compatibility is just as complex an area as cross-browser compatibility. Perhaps even more so, these days.

Thanks Drew.

So, reading between the lines, do I understand correctly that this isn't something you can support? If so, no worries - I have another solution up my sleeve.

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, it's not that, it's just I'm not sure where to go next.

OK, that's great news. If I can help in any way, let me know.

For me, it seems odd that the corrupted URLs are only being created for "grandchild" pages. "Child" pages do not have corrupted URLs even though they're created through the same process (I assume).