0

I've found this free template for Joomla. There is a quickstart package to get a ready-to-go website, similar to the demo. First I've installed XAMPP v1.8.3 (with PHP v5.5.14) on my Windows pc and then I succesfully get the demo working on my localhost. Then I tried to move the website to my online host (Linux, PHP v5.5.11). I moved all the files with FileZilla and the local MySQL database with a sql script, as illustrated by Joomla. When I open the home page of my website I can't see the demo and I get this error instead:

Parse error: syntax error, unexpected end of file in /web/htdocs/www.mywebsite.com/home/modules/mod_otslideshow/classes/otimage.class.php on line 1

This is the content of the file:

<?php
/* Credits - cut -*/
defined('_JEXEC') or die('Restricted access');
class OTImage {
//cut
}

Brackets are ok. Notepad++ shows me that the last "}" closes the OTImage class (if you want the very long code of the class I can provide it). I'm not a PHP experts, but I noticed that there was a missing PHP close tag ?>. Then I read that it is not a syntax error. What could be the reason for this error? Localhost PHP version is similar to the remote host. Is it something related to the migration? Or something related to the php.ini? My provider gives me an option to change the php.ini: there are 5 options. The first two seems to be interesting. With the first (default one) - and also the others - I get the aforementioned error; with the second (joomla specific) I get no error, but I see a blank home page. By adding a final ?> to the class I'm able to see the homepage, but the slideshow (the module that is causing problem) doesn't work (I see all the images in the page, without the slider: the component is broken). I can't understand if there is an incompatibility or a programming error. Thanks in advance.

EDIT: phpcodechecker.com says that the code is syntatically correct.

7
  • You could uninstall this module, download the installation package from the template company and install it again. Commented Aug 27, 2014 at 14:26
  • I guess the line which is leading to the error is somewhere in the OTImage class. Commented Aug 27, 2014 at 14:27
  • I can uninstall the module, but then how can I reinstall it from Joola, since it's part of the template? TiMESPLiNTER, do think the problem is in the code? I can post it... But why does it work on localhost? Commented Aug 27, 2014 at 14:37
  • Try unpublishing the module. Commented Aug 27, 2014 at 14:59
  • But I need that module. What should be the purpose of unpublishing it? The other things work. Commented Aug 27, 2014 at 15:12

1 Answer 1

1

Usually this occurs when a php file is corrupted or not fully transfered.

Did you move the site via ftp.

If ftp then has it finished?

Did you got any errors on transfer?

Remember you have a "on line 1".

Sign up to request clarification or add additional context in comments.

1 Comment

I agree on this. The issue is that <?php is not being recognized ... there could be a hidden character or something else. Sometimes deleting the line and rewriting <?php will do the trick. Check the color coding in the editor and make sure it looks correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.