ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So I set up a virtual server on Ubuntu.
I uploaded a webpage in PHP which had no errors on the another Ubuntu server and on my local computer but for some reason shows a parse error on the Ubuntu Virtual server. So I'm wondering what the possibilities are for causing this error because I know for a fact the webpage has no errors unless different Ubuntu versions have different set of rules. Because the other OS I tested the webpage on is a slightly different linux distribution but same PHP version that is PHP7.
So I set up a virtual server on Ubuntu.
I uploaded a webpage in PHP which had no errors on the another Ubuntu server and on my local computer but for some reason shows a parse error on the Ubuntu Virtual server. So I'm wondering what the possibilities are for causing this error because I know for a fact the webpage has no errors unless different Ubuntu versions have different set of rules. Because the other OS I tested the webpage on is a slightly different linux distribution but same PHP version that is PHP7.
Since you don't say what version of Ubuntu, or tell us anything about your script, or even the actual error, who knows?? Have you done any troubleshooting? Looked at the Apache and PHP log files? Checked the Apache versions?
Post your script along with the actual errors and some details, and we can try to help. But based on what you posted, there's nothing we can tell you.
There are many possibilities and all we basically know is there is something different between the two environments.
Something is not installed, installed incorrectly or configured incorrectly.
PHP is not configured correctly.
Apache or whatever web server is running is not configured correctly.
You will need to go back and reexamine the error and your script and hopefully it will become obvious why it isn't working as expected.
There are many possibilities and all we basically know is there is something different between the two environments.
Something is not installed, installed incorrectly or configured incorrectly.
PHP is not configured correctly.
Apache or whatever web server is running is not configured correctly.
You will need to go back and reexamine the error and your script and hopefully it will become obvious why it isn't working as expected.
Thanks a lot I will check now as to the version I'm using and php installation, I thought it could be something like that
just wanted to confirm.
PHP Parse Error: syntax error unexpected '}', expecting end of file in /var/www/file.php
I'm using the latest version of ubuntu which is 19.
Thanks a lot I will check now as to the version I'm using and php installation, I thought it could be something like that
just wanted to confirm.
PHP Parse Error: syntax error unexpected '}', expecting end of file in /var/www/file.php
I'm using the latest version of ubuntu which is 19.
Well, seems simple enough; you have a typo in your code. How did you put this 'file.php' onto your new server??
Finally found the error now folks, thanks a lot yeah.
It was this demon here <? that I had to change to this <?php
Though I don't understand why some linux version treat the matter differently.
It depends on distribution / version if the short open tag <? is enabled or disabled by default. Although I had read that with version 7.0 it was deprecated although from the posted PHP page it has not.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.