2

I used to use XAMPP on a Windows Computer to see how my homepage (php) works. Everything works fine without any issues.

I now installed XAMPP on my Notebook which runs on Linux. Installation went fine without any problems. When I open http://localhost I connect to the "Welcome-Dashboard".

I moved the EXACT same data in htdocs and tried to open the documents but an error occurs: Parse error: syntax error, unexpected 'version' (T_STRING) in /opt/lampp/htdocs/..../index1.php on line 1

Sometimes a different error (without changing files) occurs. Somethng about "T_STRING" error. I couldnt trigger it right now. For me it seems there is nothing wrong with the files - maybe I didnt setup XAMPP correct on my Linux(?)

I am using Ubuntu 15.10.

Thank you very much.

1 Answer 1

2

It is likely a php setting in php.ini.

short_open_tag - boolean

Tells PHP whether the short form (<? ?>) of PHP's open tag should be allowed. If you want to use PHP in combination with XML, you can disable this option in order to use inline. Otherwise, you can print it with PHP, for example: <?php echo '<?xml version="1.0"?>'; ?>. Also, if disabled, you must use the long form of the PHP open tag (<?php ?>).

Edit 'php.ini' and add (or change) ...

short_open_tag = 0
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .