I've written a php-based site on my local machine and I'm trying to run it using the Apache Web Server in XAMPP and a mySQL database, which is on my local machine, external to XAMPP. When I go to the page where it should be, however, I get the following error:
Sorry, a problem occurred. Please try later.SQLSTATE[HY000] [2002] No such file or directory
I've seen a lot of people saying this points to php.ini not being able to access mysql.sock, but all of the changes haven't worked for me. I don't have any mysql.sock files, but I do have mysqld.sock files, and I've put the paths to them in php.ini at all the points where it asks for them. I haven't seen anyone talking about mysqld.sock files and whether or not it's an issue, so any help would be valuable.
Here's my config.php, if that's valuable:
ini_set( "display_errors", true ); date_default_timezone_set( "Europe/London" ); // http://www.php.net/manual/en/timezones.php define( "DB_DSN", "mysql:host=localhost;dbname=dog_site" ); define( "DB_USERNAME", "root" ); define( "DB_PASSWORD", "***" ); define( "CLASS_PATH", "classes" ); define( "TEMPLATE_PATH", "templates" ); define( "HOMEPAGE_NUM_POSTS", 5 ); define( "ADMIN_USERNAME", "admin" ); define( "ADMIN_PASSWORD", "***" ); require( CLASS_PATH . "/User.php" ); require( CLASS_PATH . "/Litter.php" ); require( CLASS_PATH . "/Post.php" ); require( CLASS_PATH . "/PostLikes.php" ); require( CLASS_PATH . "/LitterLikes.php" ); require( CLASS_PATH . "/PostComments.php" ); require( CLASS_PATH . "/LitterPhotos.php" ); require( CLASS_PATH . "/PostPhotos.php" ); function handleException( $exception ) { echo "Sorry, a problem occurred. Please try later."; echo $exception->getMessage(); error_log( $exception->getMessage() ); } set_exception_handler( 'handleException' ); ?>```