-1

I'm running Apache24 with PHP enabled to use the Kanboard app. Everything works fine, but if I remove the path to the PHP folder from the Windows PATH, I get an error when loading the localhost/kanboard page:

Internal Error: PHP extension required: pdo_sqlite

Pages with php.info are loaded correctly.
The path to extension_dir in the php.ini file is absolute.
The path to PHPIniDir in the httpd.conf file is absolute as well.

Apache24 error.log shows:

PHP Warning:  PHP Startup: Unable to load dynamic library 'php_pdo_sqlite.dll' 
(tried: D:\\programs\\php_8.4.15\\ext\\php_pdo_sqlite.dll(\xd0\x9d\xd0\xb5\xd0\xbd\xd0\xb0\xd0\xb9\xd0\xb4\xd0\xb5\xd0\xbd\xd1\x83\xd0\xba\xd0\xb0\xd0\xb7\xd0\xb0\xd0\xbd\xd0\xbd\xd1\x8b\xd0\xb9\xd0\xbc\xd0\xbe\xd0\xb4\xd1\x83\xd0\xbb\xd1\x8c),
D:\\programs\\php_8.4.15\\ext\\php_php_pdo_sqlite.dll.dll(\xd0\x9d\xd0\xb5\xd0\xbd\xd0\xb0\xd0\xb9\xd0\xb4\xd0\xb5\xd0\xbd\xd1\x83\xd0\xba\xd0\xb0\xd0\xb7\xd0\xb0\xd0\xbd\xd0\xbd\xd1\x8b\xd0\xb9\xd0\xbc\xd0\xbe\xd0\xb4\xd1\x83\xd0\xbb\xd1\x8c)) 
in Unknown on line 0

The file is actually located at:

D:\programs\php_8.4.15\ext\php_pdo_sqlite.dll

I need Kanboard to work without modifying the Windows PATH.
I have tried many options, but nothing has helped so far.

6
  • 7
    Everything works fine. But if I remove so don’t do that? Commented 16 hours ago
  • So why are you removing it? Commented 16 hours ago
  • I need to install this on a computer where changing environment variables in the past has caused the system to reinstall. It's a long story, but it all comes down to specialized software that's sensitive to changes in system variables. Commented 16 hours ago
  • OK...so are you saying there is some other program which gets upset if php is in the Path variable?? Commented 15 hours ago
  • 1
    Ok. Well, you need the PATH setting to run PHP - there is no alternative to that. So I would say your options are: 1) Run PHP on another machine instead, or 2) Learn how to configure this monitoring system so that it will accept the change you need to make, and not treat it as a threat. Perhaps there is a system administrator or somebody like that you can work with on it. Commented 14 hours ago

2 Answers 2

1

Since your special system will monitor the system's integrity, and react to any changes to environment variables (hence you cannot change the PATH in the environment variable setting) , so one of the ways is NOT to the set PATH in the environment variables settings, but use a simple SET command.

You may use the following command:

SET PATH=%PATH%;C:\Your\Directory\To\PHP;

In your case, may be it is like

SET PATH=%PATH%;D:\programs\php_8.4.15;

Please note that the SET command does not change the system environment variables so after rebooting the machine you need to do it again.

Hence, simply put the above line as a batch file (e.g. preloadphp.bat) and so each time run this batch file before using PHP

Sign up to request clarification or add additional context in comments.

Comments

1

Some of the PHP's extensions are dependent on dll files in the PHP root folder, e.g. php_pdo_sqlite.dll is dependent on libsqlite3.dll, that's why when PHP is run by Apache, you need to add the PHP root folder to PATH so that these dependencies can be found.

This is the root of the problem, and now I can think of two options:

  1. Copy the required dll files from the PHP root folder to Apache's bin folder.

  2. Set environment variables separately for Apache service: https://serverfault.com/a/1103091

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.