Sunday, June 11, 2017

Problems faced during migration php/mysql code Windows to Linux

1.  Slashes in file names when migrating PHP project to Windows server from Linux server.
Solution : Need to remove back slash & forward slash with underscore (" _ ")

2. Case Sensitive : Mostly in windows both "A" and "a" treat same. But in Linux thinks are different. So need to take care of this. This problems faces both in PHP and MySql files and table respectively. 

You can configuring MySQL Tables to be Case Insensitive by editing the MySQL configuration file, which is generally found at /etc/mysql/my.cnf/etc/my.cnf or ~/my.cnf

Add the following line to the my.cnf configuration file:
lower_case_table_names=1
Then restart MySQL (or reboot):
/etc/init.d/mysql restart (Debian/Ubuntu/SuSE)
/etc/init.d/mysqld restart (Red Hat/CentOS/Fedora)

Today me facing problem the CodeIgniter Web Framework  code. In case of windows folder name was in cap mean in Upper case and in php coding same folder in lower case. It working fine with window server (XAMPP). But when I migrate same into Linux server (ubuntu LAMP) case sensitivity matters and creating problem to load files. You need to take care this otherwise php code does not work. 

No comments:

Post a Comment