PHP script executes in CLI but not Web Server using any browser.
Posted by: cahalsall (---.btl.net)
Date: June 02, 2018 08:42PM

I'm using a WAMP server installed on a Windows 10 machine.

I have a small script that reads data from a DBaseIV table via odbc then either updates or inserts this data via odbc into a table in a Microsoft access database. The script excutes correctly from the Command Line Interface but fails within any browser. I run scripts similar to this one using MySQL connections and they never fail.

Has anyone encountered this problem before?



PS: I have already check that the required extensions are active.



Edited 1 time(s). Last edit at 06/02/2018 08:44PM by cahalsall.

Options: ReplyQuote
Re: PHP script executes in CLI but not Web Server using any browser.
Posted by: cahalsall (---.btl.net)
Date: June 02, 2018 09:49PM

I Found the problem. It turns out the data source for the dBaseIV entry was located on a network drive, on a samba server. PHP running from the CLI had no issues with that but the Apache web server did.

Come to think of it, I had to make an adjustment to the registry so the data source entry could detect the drive.

The previous programmer wrote a small visual basic app that did the same thing. That app had not problem with the data source being on the mapped network drive. Unfortunately we lost the install package and thus the reason this script.

I would still like to know why php via the CLI could and Apache couldn't.

Options: ReplyQuote
Re: PHP script executes in CLI but not Web Server using any browser.
Posted by: RiggsFolly (Moderator)
Date: June 04, 2018 09:52AM

Did you check that the php.ini file used by Apache and the one used by PHP CLI (yes they are different) both had the required extensions included?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.