PHP and MS Access

Do you have questions regarding other database enginges (not MySQL) -- ask here!

Moderators: egami, macek, gesf

Post Reply
element121
php-forum Fan User
php-forum Fan User
Posts: 606
Joined: Sat Jun 06, 2015 11:46 am
Contact:

Fri Sep 16, 2016 3:01 am

Hi Eric,

It's probably possible to connect to Access, but you are the first person I've come across trying to do it.
Please consider converting your access database to MySQL and then you can easily do what you want.
Access wasn't designed to be used with PHP / Web Apps...

NigelRen
php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Fri Aug 05, 2011 9:53 am

Mon Sep 19, 2016 2:00 am

Have you checked that the ODBC extension in PHP is loaded? ( have a look at https://www.sitepoint.com/using-an-acce ... -with-php/ ).

NigelRen
php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Fri Aug 05, 2011 9:53 am

Mon Sep 19, 2016 6:21 am

The other thing which may happen with files is the file permissions. When you run things interactively - you will of course be using your current users permissions, run as a background process (like PHP) and this may run as a different user. As a first thing - try setting file permissions for anyone to read/write and see if that helps.

NigelRen
php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Fri Aug 05, 2011 9:53 am

Tue Sep 20, 2016 11:26 am

It's not about the user that is running the web page, it's about the user that the PHP process is running as. After all, we are both using this forum to make posts - it doesn't mean we have access to do anything with the database directly.
So (on Linux) I log in as 'nigel:nigel', but if I ran a PHP web page, it would be run in a process owned by 'www-data:www-data'. So if I can access a file and change it, it doesn't mean that the PHP web page can do the same. I have to make sure that any files that the web service needs to be able to modify are either owned by www-data or at least the permissions means they can be modified by this user.

Post Reply