Reputation:
I implemented a web based system using PHP. i coded it in Windows platform with using wamp server.But, i tried to host it in LAMP server , my code executions aren't working properly.they are not giving a error message at leasr.i think the fault is in My mySQL queries. Can any one please help me to fix this problem. thanks;
Upvotes: 1
Views: 156
Reputation: 494
Sometimes error_reporting(E_ALL);
is not enough. You might need to set this in your code as well:
ini_set("display_errors", 1);
Upvotes: 0
Reputation: 28906
The first step is to turn on error reporting. You can do this in your script like this:
error_reporting(E_ALL);
Or you can edit your php.ini file (if you have access to it):
error_reporting = E_ALL
If you edit your php.ini file, you will need to restart the webserver.
Second, you may need to update your database connection information to work with the new server. Does your host provide MySQL on the same server as your website files? If not, you may need to change the MySQL hostname from 'localhost' to something else. When you enable error reporting, appropriate errors will be displayed to help you determine the source of the problem.
Third, you should confirm that your script is compatible with the Linux environment. The two major differences are the way you specify paths, and what command are available for execution via exec()
, passthru()
, etc.
Path names on Windows use a backslash as the directory separator and may include a drive specification. Example:
C:\www\index.php
Path names on Unix-like systems (including Linux) use a forward slash and no drive specification:
/home/user/www/index.php
If you are executing any external commands using the functions mentioned above, please ensure that these functions are available in the new hosting environment.
Upvotes: 2
Reputation: 2140
You mention you think it is related to mySQL.
Also remember that if you've moved server environments you might need to update your database configuration.
Please double check how you're connecting to the database and confirm with your hosts that the details are correct.
Upvotes: 0
Reputation: 3678
It's close to impossible to help you with so little information. But one of the main differences between the two platforms is that the Windows file system is usually case insensitive, while the Linux file system is usually case sensitive. This can cause issues when loading source files, e.g. by using require()
.
Upvotes: 0