Copy/pasted from old server, now php not working

Today I decided to take some time and upload my backed up website to the new server, as per your instructions.
All was not fine, cause your tutorials and guides are just not compatible with the actual process (need to delete your account between 2 steps, but it doesn’t say that at all. Took me 15 frustrating minutes to figure out what was going on there… great job!) But then I managed to get through, managed to get through that horrible step-by-step instruction thing as well, it just kept hanging on steps cause of buttons that are not really obvious…
Then I finally got my website back running (www.broos.tk), only to notice that my PHP is not being recognized by the server… I tried setting the PHP version to 5.2 and 5.4 but for some reason, the webserver is just not processing…
I even tried uploading a simple <? echo 'test'; ?>
and that didn’t even work… What’s up with the new server guys? Did I migrate to a broken system?

Migrating like this should not be this difficult, or frustrating, in fact, it shouldn’t have to happen at all (you could’ve just updated our control panels without us having to move our data around)…

I figured it out, apparently, someone decided not to recognize php as <? ?> anymore, although it’s been a standard for 20 years…

However, half of my myself queries etc. do not work anymore… It’s selecting fine, but not updating or inserting :S

This is really pissing me off…

I see you’re trying to use php short tags…
To use php short tags you need to follow this tutorial.

Thanks for your reply, but I already figured out that issue…
Trying to solve why my sql queries are not recognized now, probably also because I’m using the method that was standard for 15 years and now has been disabled…

Also, this basically means that your PHP version thingie doesn’t work - since the mysql_query() function should still be working pre-php 7.00

If you’re using “mysql” function(not “mysqli”)…then you need to downgrade to php version 5.4 or even less.
To downgrade phpversion “settings” – “general” --“php version”

As I said, that doesn’t work.

Can you post your php script which you said is not working.

it was never a standard. It was deprecated years ago. Mainly because of the confusion to the same syntax for <?xml tags.

Not going to share the entire code, but here’s the line that I’m still having trouble with (when using single quotes in msgBody)

$_POST[title]=htmlspecialchars($_POST[title]);
$_POST[msgBody]=htmlspecialchars($_POST[msgBody]);
mysqli_query($link,"UPDATE `blogs` SET `title`='$_POST[title]', `blog`='$_POST[msgBody]', `tag`='$tagID' WHERE `ID`=$blog[ID]") or die(mysqli_error($link));

This line used to work perfect, but as soon as I enter single quotes in the text, it gives an SQL-statement parse-error…

Fixed that by adding mysqli_real_escape_string() to the code, never used to be necessary, because htmlspecialchars() already does that…

Well, considering I’ve been using <? ?> for over 20 years on a wide range of servers, both locally hosted and hosted by national and international companies, both Windows and *nix, both embedded and full system, I respectfully disagree with them ‘not being a standard’.
They are still enabled by default by most hosting companies and servers where I have my little projects, yet you decided not to enable them by default… That’s fine, but a headsup would’ve been nice…

1 Like

I have taken this from official php.net documentation:

http://php.net/manual/en/language.basic-syntax.phptags.php

PHP also allows for short open tag <? (which is discouraged since it is only available if enabled using the short_open_tag php.ini configuration file directive, or if PHP was configured with the --enable-short-tags option).

When official documentation states that it is discouraged i do not consider this as a standard :slight_smile:

Also you can enable short tags if you prefer:

It’s discouraged because it needs to be enabled on the server.
It can be considered a standard, when it’s enabled by ‘most’ companies.

Heck, you guys had it enabled by default before as well…

Not a direct security vulnerability but it could become one given the proper conditions.

so there is more than one reason to not include short tags by default

I have the same issue… But I’m already using long php tags (<?php echo "test"; ?>) and it’s not working in .html file… :confused:

This is different issue discussed here

Okay… I read about that also before but here again, I’m just wondering why it worked before and doesn’t work anymore with the new panel…
Anyways I got it all fixed now… Hope it was worth the effort :wink: