How to debug on production server

First of all its very bad practice to debug on the production server.

but sometime the situation arrives where we have to debug on the production server.


here is the few technique sharing to debug on production server.

1.  Debug Using Cookies.

Install Crome Extension cookies inspector .



Add Cookies Name : tester
Now Write A code to check is cookies is available or not

if(isset($_COOKIE['tester'])) {
    // Write your debug code here.
}



That all.

Resolved Fatal error: Call to undefined function mysql_connect()

First step to resolve this error to check is mysql is installed on the server and its running properly

if above case is fine than check version of php as php version 7 does not support mysql  change to mysqli

Reset MySQL Root Password on Windows (Wamp Server)

If you forgot the password for MySQL Root, then you need following the online instruction.

  1. I saved the update password and flush command to “resetpw.txt”
  2. Launch command prompt as an administrator.
  3. “C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld” –defaults-file=”C:\Program Files\MySQL\MySQL Server 5.1\my.ini” –init-file=D:\\resetpw.txt –console
  4. I included –console so that I can see any error right away.
  5. After I reset the MySQL server, I verified by running a command prompt and typed “mysql –u root –p” and entered the password when prompted.

==================
resetpw.txt  
=================
yourpassword