ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Parse Error where my navigation bar is after migration to test server

November 29, 2012 12:26pm

Subscribe [2]
  • #1 / Nov 29, 2012 12:26pm

    Qualm

    6 posts

    Hi everyone, I’m new to EE, I’ve been tasked with moving a website from oakland-leicester.co.uk to our http://www.creare-ost2.co.uk test server and have finally almost got it working apart from one problem: as you can see where the navigation is supposed to be there is this error:

    Parse error: syntax error, unexpected ‘&’ in /server_path/oaklandtest/system/expressionengine/libraries/Functions.php(640) : eval()‘d code on line 17

    Also when I go on to an inner product page for EG: http://www.creare-ost2.co.uk/index.php/catalog/kitchen-products the side navigation is missing.

    Any ideas? Help would be much appreciated

  • #2 / Nov 30, 2012 10:54am

    MadWebDesigns

    147 posts

    Hi Qualm,

    What version of EE are you running?

    Is your nav generated by EE or is it static?

    Also, I noticed something in your page source you have duplicate <body> tags. You should make sure you only have 1 as this might cause problems.

    Mike

  • #3 / Nov 30, 2012 11:31am

    Qualm

    6 posts

    Hi Mike

    Thanks for the reply

    I’m using v2.1.0 and I’m unsure about here the nav is being generated from. The thing is I’m totally new to EE and I havent built the site I’m just transferring it to our servers. I have been looking at it and I’m starting to build a picture of how it works but thats as far as I’ve got.

    Also I’ve used REElocate to alter the paths but the links still go to the oakland leicester site instead of creare-ost2.co.uk.

    As for the body tags, I’ll have a look into getting rid of the duplicated one although not sure this is immediately apparent as to where it is with my knowledge of EE.

  • #4 / Nov 30, 2012 11:43am

    MadWebDesigns

    147 posts

    Before moving the website you should sync all templates and folders, then clear the EE cache. Then when you move it, do the same on the new server after updating the URL/path info. If that still doesn’t work check your config.php file and EE admin preferences in the CP to make sure the path/URL changed accordingly after running REElocate.

  • #5 / Nov 30, 2012 12:13pm

    Qualm

    6 posts

    Ok I followed the guide on this site about migrating from one server to another and done those steps you mention, but I suppose it can’t hurt to repeat this in case I’ve missed something first time round. Another thing I noticed is that the footer links have the url like this:

    oakland-leicester.co.uk/contact?phpMyAdmin=GKC5iwSNeSiL44KGHSJab8U8M1 instead of having a clean url and the correct creare-ost2.co.uk address.

    Just noticed as I’m writing that if I type in creare-ost2.co.uk/?index.php the nav works! and the link urls are correct but when i click them they throw a 404 or direct me to the oakland leicester, it seems adding a ‘?’ after the domain finds what im looking for which makes me think this is partly htaccess issue, similar problem with another CMS I had transferred before.

    I tried using the htaccess from their original site, but it gives me a 500 server error. I think I’m lacking a functioning htaccess file that works with EE on this server because it appears the database is working and I can connect to it.

     

  • #6 / Nov 30, 2012 12:44pm

    MadWebDesigns

    147 posts

    That footer link you posted doesn’t look right. Having the “?phpMyAdmin=..” is kind of strange?

    Can you post the contents of your htaccess file so I can have a look?

  • #7 / Dec 01, 2012 7:21am

    Qualm

    6 posts

    Well thing is at the moment I have no htaccess file on creare-ost2.co.uk, but the one on the oakland-leicester server that causes a 500 error on my server is this:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    # Removes index.php
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
    # If 404s, “No Input File” or every URL returns the same thing
    # make it /index.php?/$1 above (add the question mark) </IfModule>
    php_value memory_limit 128M

  • #8 / Dec 02, 2012 12:37am

    MadWebDesigns

    147 posts

    Try changing your htaccess file to the following:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    # Removes index.php
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
    # If 404s, “No Input File” or every URL returns the same thing
    # make it /index.php?/$1 above (add the question mark) 
    </IfModule>
    php_value memory_limit 128M

    Make sure to put the </ifModule> on a new line.

    Mike

  • #9 / Dec 03, 2012 4:45am

    Qualm

    6 posts

    Tried changing the htaccess still giving me a 500 server error.

    I’ve noticed that adding a ? brings me to the correct pages, for example:

    http://www.creare-ost2.co.uk/?contact as opposed to http://www.creare-ost2.co.uk/contact results in finding the correct page and doesnt redirect to oakland-leicester.co.uk

  • #10 / Dec 03, 2012 9:24am

    MadWebDesigns

    147 posts

    Try this:

    ... 
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php?$1 [L]
    ...

    Mike

  • #11 / Dec 03, 2012 10:12am

    Qualm

    6 posts

    Tried that still same problem, although I’ve just tried :

    <br /> # Standard .htaccess file</p> <p># Secure .htaccess file<br /> <Files .htaccess><br /> order allow,deny<br /> deny from all<br /> </Files></p> <p># Don’t show any directory without an index file<br /> Options -Indexes</p> <p># Dont list files in index pages<br /> IndexIgnore *</p> <p># EE 404 page for missing pages<br /> # May differ depending on where your template is located.<br /> ErrorDocument 404 /index.php?/site/404</p> <p># Enable Rewrite Engine<br /> RewriteEngine On<br /> RewriteBase /</p> <p># Remove the www from the URL<br /> # You may be able to do this through your web host or you may not need it at all.<br /> #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]<br /> #RewriteRule ^(.*)$ http://%1/$1 [R=301,L]</p> <p># Force the www (not used here but listed for reference)<br /> RewriteCond %{HTTP_HOST} !^www\.<br /> RewriteRule ^(.*)$ <a href="http://www.%{http_host}/$1">http://www.%{http_host}/$1</a> [R=301,L] </p> <p># Add a trailing slash to paths without an extension<br /> RewriteCond %{REQUEST_FILENAME} !-f<br /> RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$<br /> RewriteRule ^(.*)$ $1/ [L,R=301]</p> <p># Remove index.php<br /> # Uses the “exclude method”<br /> # <a href="http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Exclude_List_Method">http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Exclude_List_Method</a><br /> # This method seems to work best for us, you might also use the include method.<br /> # <a href="http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method">http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method</a><br /> # Exclude root files<br /> RewriteCond $1 !^(favicon\.ico|index\.php|path\.php|php\.ini) [NC]<br /> # Exclude EE folders<br /> RewriteCond $1 !^(system|images|themes)/ [NC]<br /> # Exclude 3rd party folders<br /> RewriteCond $1 !^(css|js|assets)/ [NC]<br /> # Remove index.php<br /> RewriteRule ^(.*)$ /index.php/$1 [L]</p> <p># Remove IE image toolbar<br /> <FilesMatch “\.(html|htm|php)$”><br />   Header set imagetoolbar “no”<br /> </FilesMatch><br />

    Seems to be working better now although I cant get to the admin login screen when I use this, the other inner links now work and the nav shows up if I’m not on the homepage, which is the only time I get that parse error, It also seems I’m lacking some styles namely font and image sizing issues on some products

  • #12 / Dec 04, 2012 5:17am

    Qualm

    6 posts

    hmm that htaccess didnt copy and paste correctly. Here it is below:

    # Standard .htaccess file

    # Secure .htaccess file
    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>

    # Don’t show any directory without an index file
    Options -Indexes

    # Dont list files in index pages
    IndexIgnore *

    # EE 404 page for missing pages
    # May differ depending on where your template is located.
    ErrorDocument 404 /index.php?/site/404

    # Enable Rewrite Engine
    RewriteEngine On
    RewriteBase /

    # Remove the www from the URL
    # You may be able to do this through your web host or you may not need it at all.
    #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    #RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

    # Force the www (not used here but listed for reference)
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{http_host}/$1 [R=301,L]

    # Add a trailing slash to paths without an extension
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
    RewriteRule ^(.*)$ $1/ [L,R=301]

    # Remove index.php
    # Uses the “exclude method”
    # http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Exclude_List_Method
    # This method seems to work best for us, you might also use the include method.
    # http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method
    # Exclude root files
    RewriteCond $1 !^(favicon\.ico|index\.php|path\.php|php\.ini) [NC]
    # Exclude EE folders
    RewriteCond $1 !^(system|images|themes)/ [NC]
    # Exclude 3rd party folders
    RewriteCond $1 !^(css|js|assets)/ [NC]
    # Remove index.php
    RewriteRule ^(.*)$ /index.php/$1 [L]

    # Remove IE image toolbar
    <FilesMatch “\.(html|htm|php)$”>
      Header set imagetoolbar “no”
    </FilesMatch>

    I might just start again with this installation, I’ve just noticed the styling isnt being applied to the product images and the nav still doesnt work on the homepage. Thanks for the help so far Mike, appreciated

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases