This is my first experience using Gammu as SMS gateway, and I have a problem with the setup.
This is my system:
Windows 8.1 x64
Gammu 1.33.0 Windows x64
XAMPP 1.8.1
Database connection to MySQL using ODBC
GSM modem used: Wavecom Fastrack M1306B
And here is my smsdrc:
[gammu]
port = com6:
connection = at115200
[smsd]
Service = sql
Driver = odbc
SQL = mysql
host = localmysql
DeliveryReport = sms
logfile = smsdlog
debuglevel = 1
PIN = 1234
commtimeout = 1
sendtimeout = 10
User = root
Password =
# host = localhost
PC = localhost
Database = smsd
And here is my gammudrc :
port = com6:
connection = at115200
What I've did:
Extract the directory of gammu/bin into xampp/htdocs/gammu
Created smsrdc & gammurc files with the configs above
Set the compatibility of gammu-smsd.exe to Run As Administrator
phpmyadmin > Create new db (smsd) > imported the sql from gammu\share\doc\gammu\examples\sql\mysql.sql
My ODBC settings :
(source: kaskus.com)
(I've tested and it's connected)
- I've added the gammu-smsd into windows serices
- test identify by running gammu --identify
- test sending sms manually from console
- test gammu-smsd -c smsdrc, and i had no error at all.
The problem is I couldn't run the gammu-smsd as a service, whether it's manually from the cmd nor started it from the services.
If I started the gammu-smsd from cmd ( gammu-smsd -c smsdrc -s ), the gammu-smsd showed up in the task manager, but disappeared in less than 1 sec.
Whenever I tried to manually start the gammu-smsd service from the Windows Services, it always shows me this kind of error:
(broken image: http://cdn.kaskus.com/images/2014/01/08/270124_20140108085812.png)
I've done some searchs, and what I've found is all about wrong connection into DB, port, or about Run As Administrator. But I'm quite sure it's not from config.
How can I solve this issue, so that I can run the gammu-smsd services properly?
Can you please help me?
Thanks.
Try running not as a service :
gammu-smsd -c smsdrc
in my case that do the job.
Related
I'm running Windows 10, with a WSL2 Ubuntu instance. I do my development within the WSL2 instance with the "Remote - WSL" extension of Visual Studio Code. So my VSC is running as a WSL2 application, not as a Windows application. I have an additional remote server (I'll refer to this as "Server X" which actually hosts/runs the PHP code. This remote server does not support the use of the "Remote - WSL" extension, so I use an "SFTP" extension to push my changes to this server. And I cannot run the code locally (in either Windows or WSL2) due to the database connection being unsupported.
I'm trying to configure remote debugging of the code on Server X from within VSC running as a WSL2 application (IE: using the "Remote - WSL" extension). The intent is to listen for a browser request to initiate the debug session.
What's happening is when I turn on "Listen for Remote Connection" in VSC when running as a WSL2 application, it doesn't detect the browser when I refresh it. I've determined the reason is because while running as a WSL2 application, my IP is different than when I'm outside WSL (which is where I'm refreshing the browser). So in short, I'm initiating a browser session outside of WSL (IP: 192.168.1.2), the remote server attempts to connect to a debugger at 192.168.1.2:9003, but doesn't find one because my VSC is listening on 192.168.1.3:9003 while it's running as a WSL2 application.
I've confirmed if I instead run VSC as a Windows application (IE: not using Remote - WSL extension on WSL2 instance) everything works fine after adjusting some setting paths to point to Windows PHP rather than WSL2 PHP.
I've been trying to play around with using SSH tunnels to re-route my port 443 traffic from Windows through WSL, but have been unsuccessful so far.
Has anyone run into this issue and have any idea how to get around it? Or is what I'm trying to do unsupported/discouraged?
So WSL runs under the 172.16. 0.0/12 private address range and is not directly accessible by anything external to the host Windows machine. As such, populating xdebug.client_host with this IP, will not work.
My initial idea of using port forwarding was correct, but not in the direction I thought. Instead of redirecting the outgoing web traffic (443 since my site is using SSL) from Windows through WSL, then redirect from WSL to Server X. I instead just needed to redirect the incoming xdebug traffic (9003) from Windows to WSL. (Probably what #Derick was alluding to)
To do this, I left xdebug configured as it normally would have been if WSL wasn't in the picture.
So:
zend_extension=xdebug
xdebug.mode=profile,debug
xdebug.idekey=<ide key value here>
xdebug.client_host=<ip of windows host, as backup>
xdebug.start_with_request=trigger
xdebug.trigger_value=<my trigger value>
xdebug.discover_client_host = 1
Then, using the following PowerShell script on the Windows host to redirect port 9003 from the Windows host to the WSL guest:
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if ($found) {
$remoteport = $matches[0];
}
else {
Write-Output "IP address could not be found";
exit;
}
$ports = #(9003);
for ($i = 0; $i -lt $ports.length; $i++) {
$port = $ports[$i];
Invoke-Expression "netsh interface portproxy delete v4tov4 listenport=$port";
Invoke-Expression "netsh advfirewall firewall delete rule name=$port";
Invoke-Expression "netsh interface portproxy add v4tov4 listenport=$port connectport=$port connectaddress=$remoteport";
Invoke-Expression "netsh advfirewall firewall add rule name=$port dir=in action=allow protocol=TCP localport=$port";
}
Invoke-Expression "netsh interface portproxy show v4tov4";
Above script is modified from the script found here:(https://dev.to/vishnumohanrk/wsl-port-forwarding-2e22)
Which itself is modified from here: (https://github.com/microsoft/WSL/issues/4150#issuecomment-504209723)
Note*: You have to install net-tools in the WSL guest in order for the above script to work, so: sudo apt install net-tools.
I am trying to run a zend + doctrine web application from a Debian 9 host, using php 5.6
I've the need to connect to a sql server that is on different host (it's a windows machine, obviously)
I tested connection using isql command line and I am correctly able to login and to operate in the desired db
The problem is that the webabb do not return me any error but simply fails to login (i am not the developer of this webapp).
Configuration follows:
odbcinst.ini
[FreeTds]
Description = MS SQL database access with Free TDS
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
UsageCount = 1
Trace = Yes
TraceFile = /tmp/odbcinst.log
freetds.ini
host ip is exact, I removed when pasting here
[flower1]
host = xxx.xxx.xxx.xxx
port = 1433
tds version = 7.3
odbc.ini
[test_flower1]
Description=Test for MSSQL Server on flower1
Driver=FreeTds
Database=test_flower1
ServerName=flower1
TDS_Version=7.3
application.ini
;; Database
doctrine.dsn = "odbc:Driver={Sql_server};Server=flower1;Database=test_flower1;Uid=<redacted but correct>;Pwd=<redacted but correct>;"
How can I debug the source of the problem?
I've not previously experience with zend/doctrine
The problem was due to this
doctrine.dsn = "odbc:Driver={Sql_server};Server=flower1;Database=test_flower1;Uid=<redacted but correct>;Pwd=<redacted but correct>;"
I solved simply adding the port !
doctrine.dsn = "odbc:Driver={Sql_server};Server=flower1;Port=1433;Database=test_flower1;Uid=<redacted but correct>;Pwd=<redacted but correct>;"
I'm developing a web application with an AWS EC2 server (using php) to access a MS SQL Server database.
After a long search for solutions, I found this solution to use an ODBC driver. Fine, the development went well and I have no problems to connect to database or persist data.
But when I deployed my application, any action returns this error:
ERRO: IM001: [unixODBC][Driver Manager]Driver does not support this
function
I really tried all that I know and couldn't resolve this.
My EC2 configuration is:
yum install unixODBC unixODBC-devel freetds freetds-devel
And my odbc/freetds conf files are:
/etc/odbc.ini
[TDS_NAME]
Description = decription
Driver = TDS_NAME
Database = MY_DB
Servername = TDS_NAME
UID = VIPS
Port = 1433
TDS_Version= 7.3
/etc/odbcinst.ini
[TDS_NAME]
Description = TDS Connection
Driver64 = /usr/lib64/libtdsodbc.so
Setup64 = /usr/lib64/libtdsS.so
FileUsage = 1
UsageCount = 1
[ODBC]
Trace = yes
TraceFile /tmp/odbc.log
/etc/freetds.conf
[TDS_NAME]
host = MY_HOST
port = MY_PORT
tds version = 7.3
I run my queries using odbc_execute() or odbc_exec() and the error happens when my consult has some parameter. I'm pretty sure that the problem isn't my configuration files because I can connect successfully to the server and run a simple "SELECT * FROM table" and connect using isql running any query goes well.
Anyone can help me?
OBS: PHP RUNNING VERSION - PHP 5.6.10
A few things to consider:
What version of FreeTDS are you running?
What version of SQL Server are you running?
You need this to properly pick the correct TDS version. You're configured to use TDS 7.3, which would require FreeTDS 0.95 and SQL Server 2008. If you're just doing basic stuff, perhaps consider changing your TDS Version to 7.2 or 7.1?
Here's a handy chart of what features are supported by which TDS version in FreeTDS:
http://www.freetds.org/userguide/choosingtdsprotocol.htm
Good luck!
I am trying to connect to Oracle 11gR2 Xe on Ubuntu 13 server from another computer in the network, via PHP.
I am using installs and examples followed from oci_connect like here:
<?php
query_cities();
function query_cities() {
if {
$c = oci_connect("hr", "hr", "localhost:1521/XE");
;
} else {
echo "No connection"; }
?>
or another example like:
$c = oci_connect("hr", "hr", "192.168.1.33:1521/XE");
I have already enabled the remote connection in DB via SqlPlus
SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
and i have unlocked the user HR
SQL> ALTER USER hr ACCOUNT UNLOCK;
but I can only find some connection via IPv6 on the network from SQL Developer, like netstat:
tcp6 0 0 192.168.1.33:1521 192.168.1.2:57563 ESTABLISHED 14843/oracleXE
tcp6 0 0 192.168.1.33:1521 192.168.1.2:59314 ESTABLISHED 15665/oracleXE
not from my browser and they are not on tcp IPv4. The browser window remain white .. no reaction, unresponsive and no error message.
Should this be due to the TNSLR IP is active only on IPv6 or non of the oci_connect formulas are good enough or I am missing some other else?
I would appreciate any help on this issues
Alright, on the basis of received advice to seek the error in logs, I've found the message "*There is something wrong with your system - please check that ORACLE_HOME and LD_LIBRARY_PATH are set and point to the right directories*" and I decided to go through the sophisticated process of installing the Oracle InstantClient and reinstall OCI8 package, after the model from st-curriculum.oracle - with very small modifications, as follows:
Oracle 11g R2 XE database and Apache2 / PHP server have been apriori installed on Ubuntu 13.10 server and system prepared (with prereqiuzite, swap file, kernel parameters, memory leak error recover, libraries and chkconfig emulator), as described in many posts.
I stopped apache2 server
service apache2 stop
and started DRCP connection pooling as in st-curriculum.oracle.com
I created a user named PHPHOL (and alternate install Oracle's sample HR schema, if not already done at oracle install)
Next I downloaded the Basic and the SDK Instant Client packages from OTN: oracle.com/technetwork/database/features/instant-client/index-100365.html and unzipped the packages in $ORACLE_HOME, (/u01/app/oracle/product/11.2.0/xe)
Then I downloaded the OCI8 packeage from pecl.php.net/package/oci8 and installed in /opt/oci8 as instantclient
phpise
./configure --with-oci8=instantclient,/u01/app/oracle/product/11.2.0/xe/instantclient_11_2
make / make install
I set the oracle environment path as in oracle technote
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/instantclient_11_2
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH=/opt/oci8/modules
nano /etc/ld.so.conf.d/oracle.conf
and insert: /u01/app/oracle/product/11.2.0/xe/instantclient_11_2
nano /etc/ld.so.conf.d/oci8.conf
and insert: /opt/oci8/modules
nano /etc/ld.so.conf.d/shared.conf
and insert the installed shared extensions location: /usr/lib/php5/20121212
ldconfig
Next I edited the configuration file php.ini to add: extension=oci8.so, set the date.timezone directive and added also the OCI8 1.4 extension class: oci8.connection_class = MYPHPAPP (for the st-curriculum.oracle.com examples, see link above)
I made the link: $ORACLE_HOME/instantclient_11_2/libclntsh.so.11.1. to points to $ORACLE_HOME/instantclient_11_2/libclntsh.so
Restart Oracle database and Apache services on Ubuntu 13.10 server
/etc/init.d/oracle-xe force-reload
service apache2 start
I verified in phpinfo() the oci8 was enabled, and I made the connect.php file like:
$conn = oci_connect("hr", "hr", "localhost/xe");
or like the one from st-curriculum.oracle.com example.
From another computer on the same network I connected through a browser to oracle database on Ubuntu server and I've got
Connected to Oracle!
I hope this help
On one computer with Windows 7 connecting to memcache runs OK, but on another I get:
Warning: memcache_connect() [function.memcache-connect]: Can't connect to localhost:11211
Code which I'm trying to run is:
$memcache_obj = memcache_connect('localhost', 11211);
I also can't connect via telnet, a failed connection.
start>run type CMD , in the console window type netstat -a -n , do you see something like 0.0.0.0:11211 ... LISTENING ? , if no , probably memcached is not running , or is configured to another port .
In the console , try c:\memcached\memcached.exe -d start 'supposing you have memcached installed in c:\memcached .
to run memcached as windows service , try memcached.exe –d install .
YOU SHOULD START THE CONSOLE AS AN ADMINISTRATOR . try start>all programs > Accessories , then right click on command prompt and run as administrator , then apply all of the above
Memcached is either not running on the machine that you can't connect on or the instance of memcached running on that machine is configured to use a different port.
If you don't have (or want) an instance of memcached one each machine you will need to change "localhost" to the IP of the machine that is running memcached (assuming they are networked).
If it is set up try starting memcached again, and ensure you're using port 11211.