Page stops loading on first perch statement.
Installing on a third party server whereas I normally install on my own hosting package where I don't normally run into these problems.
Perch has installed.
Added the runtime statement to the top of the page as usual.
Added in a first Perch statement, nice and simple one:
<title><?php perch_content('Meta Title'); ?></title>
And when I load the page the view source shows it's getting this far:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" />
<title>
And no further so it's getting stuck at the perch statement.
Any ideas why this might be?
Did you get a Pass from the Server Compatibility Test for this server?
If yes, you will need to look in the error log to find out what error is being thrown.
Compatibility test fine apart from an image plugin that's not on their server. But don't think that's the issue.
Last line of error log:
[Tue Mar 15 08:16:22 2016] [error] [client 66.249.79.165] PHP Fatal error: Call to undefined function perch_content() in /opt/ftpdata/wessexgroup/www/about.php on line 8
This the perch_content tag I'm using:
<title><?php perch_content('Meta Title'); ?></title>
And I have to set the path to runtime to the root even though it's in a folder on the same directory level as the web page.
<?php include('/perch/runtime.php'); ?>
If I set:
<?php include('perch/runtime.php'); ?>
as per usual the web page throw a 500 error.
So have you resolved your issue?
No, still got the issue I'm describing above.
Ok, it really sounds like the issue is your path to the Perch runtime.
<?php include('perch/runtime.php'); ?> should do it as the perch folder is on the same level as the webpages.
But this throws a 500 error.
What error is logged for that? There should be an error for the include statement before the undefined function is called.
[Tue Mar 15 15:39:46 2016] [error] [client 66.249.65.77] PHP Parse error: syntax error, unexpected '[', expecting ')' in /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchFieldTypes.class.php on line 1465
Are you on PHP 5.3?
The server this is being hosted on (third party) is yes. Is this a problem?
Only for this build - there should be a new one in a day or so.
Ah ok. Shall I hold on for that update then?
Yes, or switch to a current version of PHP if that's an option.
I've asked and they don't want to upgrade as it's on a server with lots of other code.
I'm running a number of sites on my server that has a very old PHP version: PHP 5.3.29 is very out of date.
Should I be concerned about these too?
PHP 5.3 and 5.4 are end-of-life and no longer get security updates. I can see why the host wouldn't want to mess with a server that's got lots of stuff on it, but it's something to think about.
I've asked them and they said it's what was on the server when it was installed a few years ago. I'm speaking to them about an upgrade.
Perhaps I need to do the same with my client with their server.
Ok, got them to update to php 5.7.
But still getting this in the error logs:
[Wed Mar 16 13:40:34 2016] [error] [client 66.249.78.30] PHP Warning: include(/perch/runtime.php): failed to open stream: No such file or directory in /opt/ftpdata/wessexgroup/www/about.php on line 1 [Wed Mar 16 13:40:34 2016] [error] [client 66.249.78.30] PHP Warning: include(): Failed opening '/perch/runtime.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /opt/ftpdata/wessexgroup/www/about.php on line 1 [Wed Mar 16 13:40:34 2016] [error] [client 66.249.78.30] PHP Fatal error: Uncaught Error: Call to undefined function perch_content() in /opt/ftpdata/wessexgroup/www/about.php:8\nStack trace:\n#0 {main}\n thrown in /opt/ftpdata/wessexgroup/www/about.php on line 8
And the page stops loading at the first perch tag.
And the perch test throws a 500 error when loading step2.php
Is it possible I need to clear the DB tables and reinstall now we've upgraded to 5.7?
/perch/runtime.php
looks like it's not a correct path.Your site is in
/opt/ftpdata/wessexgroup/www
What does a path of
/opt/ftpdata/wessexgroup/www/perch/runtime.php
give you?Just changed the path to this and still get errors:
[Wed Mar 16 16:06:58 2016] [error] [client 81.147.189.72] PHP Fatal error: Uncaught Error: Class 'mysqli' not found in /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchDB_MySQLi.class.php:27\nStack trace:\n#0 /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchDB_MySQLi.class.php(76): PerchDB_MySQLi->open_link()\n#1 /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchDB_MySQLi.class.php(300): PerchDB_MySQLi->get_link()\n#2 /opt/ftpdata/wessexgroup/www/perch/core/apps/content/PerchContent.class.php(900): PerchDB_MySQLi->pdb('/about.php')\n#3 /opt/ftpdata/wessexgroup/www/perch/core/apps/content/PerchContent.class.php(880): PerchContent->_get_content()\n#4 /opt/ftpdata/wessexgroup/www/perch/core/apps/content/PerchContent.class.php(52): PerchContent->_populate_cache_with_page_content()\n#5 /opt/ftpdata/wessexgroup/www/perch/core/apps/content/runtime.php(26): PerchContent->get('Meta Title')\n#6 /opt/ftpdata/wessexgroup/www/about.php(8): perch_content('Meta Title')\n#7 {main}\n thrown in /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchDB_MySQLi.class.php on line 27, referer: https://test.wessex-group.co.uk/ [Wed Mar 16 16:06:59 2016] [error] [client 66.249.78.30] PHP Fatal error: Uncaught Error: Class 'mysqli' not found in /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchDB_MySQLi.class.php:27\nStack trace:\n#0 /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchDB_MySQLi.class.php(76): PerchDB_MySQLi->open_link()\n#1 /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchDB_MySQLi.class.php(300): PerchDB_MySQLi->get_link()\n#2 /opt/ftpdata/wessexgroup/www/perch/core/apps/content/PerchContent.class.php(900): PerchDB_MySQLi->pdb('/about.php')\n#3 /opt/ftpdata/wessexgroup/www/perch/core/apps/content/PerchContent.class.php(880): PerchContent->_get_content()\n#4 /opt/ftpdata/wessexgroup/www/perch/core/apps/content/PerchContent.class.php(52): PerchContent->_populate_cache_with_page_content()\n#5 /opt/ftpdata/wessexgroup/www/perch/core/apps/content/runtime.php(26): PerchContent->get('Meta Title')\n#6 /opt/ftpdata/wessexgroup/www/about.php(8): perch_content('Meta Title')\n#7 {main}\n thrown in /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchDB_MySQLi.class.php on line 27 [Wed Mar 16 16:07:09 2016] [error] [client 66.249.78.30] PHP Fatal error: Uncaught Error: Class 'mysqli' not found in /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchDB_MySQLi.class.php:27\nStack trace:\n#0 /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchDB_MySQLi.class.php(76): PerchDB_MySQLi->open_link()\n#1 /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchDB_MySQLi.class.php(300): PerchDB_MySQLi->get_link()\n#2 /opt/ftpdata/wessexgroup/www/perch/core/apps/content/PerchContent.class.php(900): PerchDB_MySQLi->pdb('/about.php')\n#3 /opt/ftpdata/wessexgroup/www/perch/core/apps/content/PerchContent.class.php(880): PerchContent->_get_content()\n#4 /opt/ftpdata/wessexgroup/www/perch/core/apps/content/PerchContent.class.php(52): PerchContent->_populate_cache_with_page_content()\n#5 /opt/ftpdata/wessexgroup/www/perch/core/apps/content/runtime.php(26): PerchContent->get('Meta Title')\n#6 /opt/ftpdata/wessexgroup/www/about.php(8): perch_content('Meta Title')\n#7 {main}\n thrown in /opt/ftpdata/wessexgroup/www/perch/core/lib/PerchDB_MySQLi.class.php on line 27