I have a internal use PHP site at my new position. It only runs a few days a year off site so we keep it on laptops. The hardware it has been on, a 8 year IBM Thinkpad running Fedora, is dying. I have new Lenovo Thinkpad's running latest and greatest Ubuntu. I have copied the contents of var to a shared drive, renamed the old www folder in var on the new machine and copied over the old www folder. I can get to the login page and into the site, but when I look something up it returns Cannot Open. I know I cannot get to the MySQL in the new machine because users and passwords dont match. The version of the PHP from the old machine is before the setup script was included. I know very little about PHP. I am looking for input on the proper way to link the old PHP files to my mysql instance. Any help, much appreciated.
By default if your php is setup on your machine with mysql it should already be linked to each other, however your php code is more than certainly not using correct mysql authentication details as you said, given the laptop was 8 years old the code is likely also programmed in a version of php older than your current one and likely the script code is no longer compatible
You should check your script for the database access details to modify, hopefully if the script was written well or using a well known framework then it should only be in one file like config.php or db.inc.php, this file will be somewhere within your /var/www folder.
If you manage to satisfy the database issues then you should be ok but its likely going to have other problems from the difference in php versions and will need the code fully reviewing.
Also other pitfalls are file permissions, you need to make sure the /var/www folder is readable by the webserver user (usually nobody) so a
Also copying the /var/lib/mysql folder to copy databases is both not recommended and unlikely to work if mysql is now a newer version to the old laptop, you should do a manual db dump of this from the old laptop and do an import on the new laptop.
Without much more info i cant give any more specific help