Apache2, PHP5, and Interbase/Firebird on Windows 2003/XP - php

I have recently upgraded from Apache 1.26 and PHP 4.3 to 2.2.11 and 5.2.9 respectively. With my original setup I had a scheduled task set to run every Sunday for a weekly newsletter. It would connect to my database (Interbase/Firebird) to find out what events were opening for the following week and get the list of addresses the email will be sent to. Of course, I had to change how PHP the task was setup since command line execution has changed slightly from version 4 to 5. Once that was fixed the real problem reared it's head.
Now when executing any script from the command line I cannot connect to my database. I receive the following error from ibase_errmsg: Unable to complete network request to host "localhost". Failed to locate host machice. Undefined service gds_db/tcp.
The same script works perfectly from the browser. Also, the database connect code is used all through my site for logging in, getting records, and updating records.
If anyone has any idea why a script will not connect to the database when executed from the command line, please help.

Sorry for the post everyone. I have answered that question. I had to copy my fbclient.dll file in to my PHP folder and rename it gds32.dll.
Does anyone know why I had to do this for executing command line scripts only, and not for scripts that run in the browser?

Related

Running MySQL locally after MacOS High Sierra Version 10.13.4 Update

Having recently Updated my MacOS to the latest version 10.13.4, my Locally run version of MySQL (Ver 14.14 Distrib 5.7.22, for osx10.13 (x86_64)) would no longer start properly. I get the following error when I try to run it using mysql start: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
And When I try to run it using mysql.server start, sometimes it starts and works for a few seconds, before stopping again.
Other times, I get the following error:
ERROR! The server quit without updating PID file (/usr/local/var/mysql/My-MacBook-Pro.local.pid).
When I navigate to this location /usr/local/var/mysql/My-MacBook-Pro.local.pid, I notice that the .pid file is missing, rather a .err file having the same name exists in it's stead. When I open this file I see that it contains nothing. And when I rename it have the .pid extension, mysql.server start works for a few seconds again, before I observe that the .pid file get changed to a .err file again (I observe this in realtime from a finder window).
Asides from Having to uninstall and reinstall mySQL again, I can't seem to find a practical solution. Last time I did this was around three days ago. And now it's stopped working again.
Could someone explain what seems to be going on?

can execute php file from browser but cron job get fatal error on shared server hostgator

I can execute my php scrape file by typing in the address bar:
domain.com/scrape.php
However, I try to use cron job on my shared server on host gator by this command:
/usr/bin/php-cli public_html/scrape.php
I got this error message:
Fatal error: Call to undefined function GuzzleHttp\Handler\curl_reset() in /home4/username/public_html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 78
I already update my php version to stable 5.6 or even 5.7 version also same error. I think that it should not be php version error because I still can execute the file from browser right ?
Also I cannot reboot server Apache because hostgator support said they cannot reboot it until the server is totally down...
Any help please ! Thank you !
I ran into this problem last week on my own server. As it turned out, my browser was looking at one installation of PHP and cron was looking at a 2nd installation of PHP. One way to check is to run a PHP script through your browser that executes phpinfo(). That will tell you what the browser is running. Have cron do the same and save the results. Compare the two and make sure they're pointing to the same installation of PHP. Don't just check versions. Check install paths and loaded modules. Cheers.

PHP - How to get data from database which is in another pc?

A quick question. I have two laptops, installed with WAMP, both using MYSQL.
I tried ping each other -> success
Configure the phpmyadmin -> require and allow ip addresses ->success
View phpmyadmin of another pc typing 192.168.0.*->succes
But when i tried to putting php code on laptop A with '192.168.0.*' as host , it came out an error, saying server not responding, run time error...
Try giving the following line in the mysql configuration file. And make sure the privilege is there for the user.
bind-address=YOUR-SERVER-IP

connect to SQL Anywhere by TCP/IP

I'm new in sql anywhere, currently I'm trying to connect using PHP.
This is what I've got so far:
$conn = sqlanywhere_connect ( "UID=usr;PWD=pass;ENG=serv;DBN=bd_name;COMMLINKS=TCPIP{HOST=10.1.1.189:2638}" );
SQL Anywhere is installed on another machine, where I can't run apache, website is running on localhost (xampp). This is only for test, when website would be ready I will connect to correct db.
This is error I've got:
Warning: sqlanywhere_connect(): The SQLAnywhere client libraries could not be loaded. Please ensure that dbcapi.dll can be found in your PATH environment variable. in C:\xampp\htdocs\core\cache\includes\elements\modsnippet\25.include.cache.php on line 21
I haven't got dbcapi.dll file, but I'm not sure I should have it.
In documentation I couldnt find this file (SQL Anywhere 10 which I've got), but for SQL Anywhere 11 I could find pages where was info about this file.
To use sqlanywhere_connect I've download SQL Anywhere module for curren ver. of PHP onto my machine and I've add it to php.ini file.
What should I do? Should I download missing file? Would it be enough or I could get more errors asking for other files?
I had a similar problem and the solution proposed here:
https://groups.google.com/forum/#!msg/sql-anywhere-web-development/zK9Tf-X3cYk/GAoqK2DnB9EJ
worked for me.
Specifically, my xampp + php needed the 32 bit dbcapi.dll but when I installed SQL Anywhere 12 I neglected to check the box to install the 32 bit version as well. Re-installing, chossing "modify" and installing the 32 bit SQL Anywhere 12 got "php test.php" working.
I would down load the missing file and go from there you are using xamp which is pre-built to talk to mySQl I doubt there is any extra .dll in the Instillation to connect with SQLAnywhere

mssql_connect stopped working mysteriously

I have a linux box that overnight decided to start acting up. I have two different errors that have appeared.
My php script runs the following:
$sql_connect = #mssql_connect($SQLServer, $SQLUser, $SQLPass) or die("Some message about this not working\n");
And I get the error:
PHP Warning: [IM002][0][Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified in /var/php/autocreate-new-students.php on line 23
In a separate script, pointing to a different box, I run the exact same line (different server/user/password information) and the die message echoes back to me.
I verified username/passwords, updates, firewalls, logs, services.. There were absolutely no changes or installs to any box during the time period when it stopped working.
I was thinking there might be a certificate of some kind that expired, but I'm not experienced enough in Linux to investigate. Any suggestions what may have caused this problem to appear?
It appears as though your DSN changed, or your database was dropped. Most likely, the configuration file for your DNS disappeared.

Categories