Same version of MySQL and PHP works on linux but not on Windows?
Posted by: JohnyBeGood (---.marinko.us)
Date: October 12, 2017 10:04PM

Hello,

So I have this website/script that is no longer developed and it has been shut down for quite some time. I would like to keep it as read only (archive.mydomain.com), no new registration. It still works fine with PHP 5.3.10 but any other version it starts throwing errors and the page does not open. On WAMPserver I've setup PHP 5.3.10 and MySQL 5.6.37
Which are the same version where it currently works (Inmostion hosting) and they use same versions just on Linux (CentOS or Red Hat, not quite sure).
I've copied all files over to WAMPserver and impored DB in PHPMyAdmin and created same DB name and username/password but it does work.

My question is, how do I troubleshoot this and determine why its not working on Windows? I'm out of ideas.

TIA

Options: ReplyQuote
Re: Same version of MySQL and PHP works on linux but not on Windows?
Posted by: RiggsFolly (Moderator)
Date: October 13, 2017 10:15AM

Hi Johny

But it does not work
That's not really a useful description of the problems you are having. Unfortunately noone here is clairvoyant.

Start by looking at error logs.

---------------------------------------------------------------------------------------------
(Windows 7 Pro 32bit) (Wampserver 3.0.6 32bit)
<Apache 2.4.23/2.2.31> <PHP 7.1.2/7.0.16/5.6.28/5.5.38/5.4.45/5.3.29> <MySQL 5.7.10/5.6.17/5.5.28>
<MariaDB 10.1.21> <phpMyAdmin4.6.5.2> <MySQL Workbench 6.3.6.511>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin -- WAMPServer alternate Repo
-?-?-?- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -?-?-?-

Options: ReplyQuote
Re: Same version of MySQL and PHP works on linux but not on Windows?
Posted by: JohnyBeGood (---.marinko.us)
Date: October 16, 2017 04:11PM

RiggsFolly Wrote:
-------------------------------------------------------
> Hi Johny
>
> But it does not work
> That's not really a useful description of the
> problems you are having. Unfortunately noone here
> is clairvoyant.
>
> Start by looking at error logs.

Thanks for the reply!

I've checked Apache and PHP error log but both are empty. Only Apache access log shows:

127.0.0.1 - - [16/Oct/2017:07:02:58 -0700] "GET / HTTP/1.1" 200 3309

Error is displayed on the website, similar when I try to access it with newer version. I'm out of ideas sad smiley

/*
| | (c) 2004 mkportal.it 
| [www.mkportal.it] 
| Email: luponero@mclink.it | 
+--------------------------------------------------------------------------- | | > MKPortal | > Written By Amedeo de longis | > 
Date started: 9.2.2004 | 
+-------------------------------------------------------------------------- */ 
define ( 'IN_MKP', 1 ); 
/* start of MKPortal Query String HTML Injection Vulnerability [www.mkportal.it] */ 
$_SERVER['QUERY_STRING'] = str_replace(array('%3C', '%3E', '<', '>'), array('', '', '', ''), $_SERVER['QUERY_STRING'] );
$_SERVER['PHP_SELF'] = str_replace(array('%3C', '%3E', '<', '>'), array('', '', '', ''), $_SERVER['PHP_SELF'] ); 

/* end of MKPortal Query String HTML Injection Vulnerability [www.mkportal.it] */ 
$MK_PATH = "./"; 
require $MK_PATH."mkportal/conf_mk.php"; 
switch($MK_BOARD) { 
    case 'IPB': $driverf = "IPB/ipb_driverf.php"; 
    $board_functions = "IPB/ipb_board_functions.php"; 
    break; 
case 'PHPBB': 
    $driverf = "PHPBB/php_driverf.php"; 
    $board_functions = "PHPBB/php_board_functions.php"; 
    break; 
case 'VB': 
    $driverf = "VB/vb_driverf.php"; 
    $board_functions = "VB/vb_board_functions.php"; 
    break; 
case 'OXY': 
    $driverf = "oxy_driverf.php"; 
    $board_functions = "oxy_board_functions.php"; 
    break; 
case 'IPB13': 
    $driverf = "IPB13/ipb13_driverf.php"; 
    $board_functions = "IPB13/ipb13_board_functions.php"; 
    break; 
default: 
    $driverf = "SMF/smf_driverf.php"; 
    $board_functions = "SMF/smf_board_functions.php"; 
    break; 
} 
require $MK_PATH."mkportal/include/$driverf"; 
require $MK_PATH."mkportal/include/functions.php"; 
require $MK_PATH."mkportal/include/$board_functions"; 
require "$mklib->template/tpl_main.php"; 
$mkportals->input = $mklib->mkp_input(); 
if($MK_OFFLINE && !$mkportals->member['g_access_cp'] && !$mklib->member['g_access_cpa']) { 
    $message = $mklib->lang['offline']; $mklib->off_line_page($message); 
    exit; 
} 
$switch = array('blog' => "blog", 'chat' => "chat", 
                         'contents' => "contents", 'downloads' => "downloads", 
                         'gallery' => "gallery", 
                         'news' => "news", 
                         'quote' => "quote", 
                         'reviews' => "reviews", 
                         'search' => "search", 
                         'topsite' => "topsite", 
                         'donate' => "donate", 
                         'urlobox' => "urlobox", 
                         'staff' => "staff", 
                         'media' => "media", 
                         'docs' => "docs", 
                         'xebook' => "xebook", 
                         'faq' => "faq", 
                     ); 
if (!isset($switch[$mkportals->input['ind']])) { 
    $mkportals->input['ind'] = "contents"; 
} 
if (!$mklib->disablegzip && $mkportals->input['ind'] != "downloads"winking smiley { 
    ob_end_clean(); 
    @ob_start('ob_gzhandler'); 
} 
require "./mkportal/modules/{$switch[$mkportals->input['ind']]}/index.php"; 
?>



Edited 1 time(s). Last edit at 10/18/2017 10:17AM by RiggsFolly.

Options: ReplyQuote
Re: Same version of MySQL and PHP works on linux but not on Windows?
Posted by: Otomatic (Moderator)
Date: October 16, 2017 07:49PM

Hi,

> My question is, how do I troubleshoot this and determine why its not working on Windows? I'm out of ideas.
These are possibly the same PHP and MySQL versions, but have you verified that the parameters are the same on each side.

Also, is it the same ServerName?
Some WEB applications, such as Wordpress, Joomla, Drupal and many others, write the url of the site to the database, that is, the ServerName of the VirtualHost (*) is found in the database.
If you restore the database to the local site which, inevitably, can not have the same url as the actual site, you will use a bad url locally and the site will not work.

(*) It should never be forgotten that at (almost) all hosts, you use a VirtualHost without knowing it.

------------------------------------------------------------------------------------------------------------
(W7 Pro 64 bit)-Wampserver 3.1.0 32 bit - Apache 2.4.29 - PHP 7.1.10/7.0.24/5.6.31 - MySQL 5.7.20 - MariaDB 10.2.9
Wampserver 3.1.0 64 bit - Apache 2.4.29 - PHP 7.1.10/7.0.24/5.6.31 - MySQL 5.7.20 - MariaDB 10.2.9
PhPMyAdmin 4.7.4 - MysqlDumper 1.24.5

Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Same version of MySQL and PHP works on linux but not on Windows?
Posted by: JohnyBeGood (---.covingtonwater.com)
Date: October 16, 2017 08:26PM

Otomatic Wrote:
-------------------------------------------------------
> Hi,
>
> > My question is, how do I troubleshoot this and
> determine why its not working on Windows? I'm out
> of ideas.
> These are possibly the same PHP and MySQL
> versions, but have you verified that the
> parameters are the same on each side.
>
> Also, is it the same ServerName?
> Some WEB applications, such as Wordpress, Joomla,
> Drupal and many others, write the url of the site
> to the database, that is, the ServerName of the
> VirtualHost (*) is found in the database.
> If you restore the database to the local site
> which, inevitably, can not have the same url as
> the actual site, you will use a bad url locally
> and the site will not work.
>
> (*) It should never be forgotten that at (almost)
> all hosts, you use a VirtualHost without knowing
> it.


Thanks for the reply!

My windows hosts file has the following:

127.0.0.1 johny.com
127.0.0.1 www.johny.com

and in my WAMPserver hosts file I have this:

# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>


<VirtualHost *:80>
ServerName johny.com
ServerAlias www.johny.com
DocumentRoot "c:/www/johny.com"
<Directory "c:/www/johny.com/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Are you saying I should replace ServerName johny.com with ServerName *

I can easily point my domain ( johny.com) to my WAMPserver IP if that will help me troubleshoot this issue.
This mkportal.it does not exist for many years so I can't really find out how it was build.



Edited 2 time(s). Last edit at 10/16/2017 08:30PM by JohnyBeGood.

Options: ReplyQuote
Re: Same version of MySQL and PHP works on linux but not on Windows?
Posted by: Otomatic (Moderator)
Date: October 17, 2017 01:53PM

Hi,

> Are you saying I should replace ServerName johny.com with ServerName *
NO.

Look in the database and mainly in the settings of Wordpress, if there would not be a url that would not match the url of the local site.

See [codex.wordpress.org]

I remind you that this forum is aimed at the possible problems of Wampserver and not the problems encountered with the hundreds of CMS and thousands of WEB applications.

------------------------------------------------------------------------------------------------------------
(W7 Pro 64 bit)-Wampserver 3.1.0 32 bit - Apache 2.4.29 - PHP 7.1.10/7.0.24/5.6.31 - MySQL 5.7.20 - MariaDB 10.2.9
Wampserver 3.1.0 64 bit - Apache 2.4.29 - PHP 7.1.10/7.0.24/5.6.31 - MySQL 5.7.20 - MariaDB 10.2.9
PhPMyAdmin 4.7.4 - MysqlDumper 1.24.5

Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Same version of MySQL and PHP works on linux but not on Windows?
Posted by: JohnyBeGood (---.marinko.us)
Date: October 17, 2017 10:23PM

Otomatic Wrote:
-------------------------------------------------------
> Hi,
>
> > Are you saying I should replace ServerName
> johny.com with ServerName *
> NO.
>
> Look in the database and mainly in the settings of
> Wordpress, if there would not be a url that would
> not match the url of the local site.
>
> See [codex.wordpress.org]
>
> I remind you that this forum is aimed at the
> possible problems of Wampserver and not the
> problems encountered with the hundreds of CMS and
> thousands of WEB applications.

Thanks for the reply!

This is not Wordpress and even after I pointed domain to WAMPserver public IP I'm still getting same error.

I understand that you don't support other CMS but it is really odd that same copy of DB and files works on Linux but not on WAMPserver.

Options: ReplyQuote


Sorry, only registered users may post in this forum.