Install the app
How to install the app on iOS

Follow along with the video below to see how to install our site as a web app on your home screen.

Note: This feature may not be available in some browsers.

php script with mssql and mysqli - cannot run from command line

As an Amazon Associate, we may earn commissions from qualifying purchases. Learn more...

3
1
NAS
412+
Operating system
  1. Windows
I have a php script that used mysqli and mssql (as in php version 5.6)
When I run the script from a browser it runs fine (WebStation).
But if I run it from either a terminal command line or run it as a user-defined scheduled script (in Task Scheduler) it returns mysqli and mssql not found errors.
I have enabled both of these extensions within the WebStation settings.

I already tried command line running php56 from these directories, but still no luck:
/bin/php
/var/packages/PHP5.6/target/usr/local/bin/php56

I need to run the script periodically using Task Scheduler.

Clearly the script can work, but by running it via the command line must load php in a different way.
How does WebStation run php? and can I reproduce that via command line?

How can I find out the path used to run php from within a browser? If I knew that I could probably replicate it in the command line?

Note - already seen this old post:
 
Last edited by a moderator:
Welcome! Good to meet a fellow PHPer on SynoForum. Thank you for posting the work-around. This will be very useful in an upcoming project.

Just to be clear, does "folder1" refer to an optional sub-folder inside the "web" shared folder required by Web Services?

Is it safe to assume your script updates databases, files, logs, etc. but does not produce any "echo" output?

Best Regards, Ron
 
Hi Ron
re. question 'folder1' - yes, just a path to a file.
My scripts do have echo statements but they have no affect.
Also, clearly, the 'curl' extension needs to be enabled.
It would be nice to know the 'correct' solution to this problem though,
rather than bypassing it like this (anyone?)

B.
 
Thanks. Your solution is running just fine here as of this morning. Certainly adequate for a retiree's hobby project. Hope you enjoy the forum. Ron
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Popular tags from this forum

Similar threads

Nicely done! I don’t know anything about this stuff, but felt I could somewhat follow along if I needed...
Replies
3
Views
579
any thoughts on the above please are most helpful.
Replies
1
Views
574
  • Question Question
I'm new to this forum and need an answer to the same question - if you were able to get an answer, would...
Replies
1
Views
1,185
It's a bit hit and miss, what I did was to review the site configuration files that were created in...
Replies
3
Views
1,703
Hey there guys below is the php info of my site. I want to host an ecommerse site on my NAS do you think...
Replies
0
Views
920

Thread Tags

Tags Tags
php

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending content in this forum

Back
Top