ADODB library error in exe launched through php - php

I have a 32 bit executable written in VB6 that uses the ADODB library, this exe is launched by a php script.
If I run the script from the command line ('php.exe /f script.php') everything works, but when the same script is launched from the web server (apache 2.4) there is an 'automation error' in the .exe file when try to create ADODB.Connection.
Local webserver on Windows 7
It is evident that the problem is not ADODB otherwise it would never work, however I spent many hours working on the Apache and php user permissions, but the evidence shows that the user running istance of php that run the script is always the current one.
At this point I have finished the ideas, if someone has some new ones, I will be grateful

Related

How can I run a daemon on xampp using PHP?

I have an XML database that I want to manage independently from users on my website. Looking into the matter it appears that I should write a daemon script to manage my database. That is all fine and dandy but, I feel like I'm opening a can of worms. I wanted to write my daemon script in PHP, so I looked into PCNTL. But I quickly learned that PCNTL is not suited for web servers. So now I am stumped. How can I get a daemon to run on my server? Do I need to learn another language? I only want to write my own scripts. But I feel lost. I would prefer to write my daemon in PHP as I am familiar with the language.
I have been researching everything from PCNTL, CLI, SO questions, numerous articles on daemon processes... etc
I am running PHP 5.6.32 (cli), windows 7, on Apache. XAMPP 5.6.32. Unix system.
EDIT: I also have windows setup to run PHP from command prompt.
There's nothing wrong in running a PHP daemon, however it's not the fastest thing, especially before the 7.0 version. You can proceed in two ways:
Using Cron Jobs, if you're under Unix systems crontab will be fine, in this way you can specify the interval within the system automatically executes the specified script and then exit.
The true daemon, firstly you need to change the max_execution_time in PHP.ini to 0 (infinite), then in your daemon call for first function set_time_limit(0);, remember to run it only once. However if there is some failure like a thrown error uncatched the script will exit and you need to open it again manually, and don't try...catch in a while loop because it will probably go into an endless loop. Execute the script with php -f daemon.php.

mbstowcs from apache not getting executed

I am calling a perl script from one php page. This perl script calls some other scripts inturn and a C binary file. The C binary uses mbstowcs function inside. This is not getting executed correctly.
But the same thing If I call from terminal(the perl script) everything works fine.
I have given proper permissions to all the files before executing(Even gave 777 permission).
Is apache uses some other terminal session/ something else to run the scripts.
I am using ubuntu 14.04 and apache webserver.
Without given any further information, I suspect you may have run across the following situation:
Use of non standard mbstowcs feature
This information is dated I realize but it's all I can offer at this time unless you can provide some more information like an error message from your Apache log file.
Sorry I could not be of more help.

Eclipse - Run remote PHP script after build

I would like to find a way to run a remote .php script after building in Eclipse. I have a development server that runs apache/php on Linux and I write the code on a PC that does not have apahce/php installed. What I would like to be able to do is execute a php script as a last build step of the project, this script would basically perform post-build operations like temp file cleanup etc.
I have tried adding a new program builder but since I do not have a way to process php on my local machine this will not work. I do not have the option to install apache/php (or any other programs) on my local machine so everything must be done on the server. Management wants everything done in php or another "Native" process so anybody else that opens the project from the server has everything already setup.
The server is only running a LAMP stack without anything else i.e. Ruby etc.
Thanks for the help!

Calling file_put_contents only works once every 10 seconds

To test this out further I created a script called 'console' and made it executable. The contents of the script were the following:
#!/usr/bin/env php
<?php
var_export(file_put_contents('test.txt', 'data'));
exit;
The output of the var_export was always 4 - yet if I deleted test.txt and ran the script again a file was only written when once every 10 seconds or so.
I'm running this script on PHP 5.5.9 on a Ubuntu Server 14.04 VM. I do not have the Zend Opcache enabled for console usage, and have confirmed that it is indeed disabled while running this script.
Edit: A little more information. Running this script directly on my machine (not in a VM, on Ubuntu Desktop 14.04, with PHP 5.5.9) works fine, it creates the file every time without fail.
To add a little extra information, the particular shared folder that this is using in the VM is mounted via NFS.

Running continuous PHP (script) background processes on a WAMP server

I got the 140dev Twitter framework (which uses the Twitter phirehose) manually
running (via the webbrowser on my local wamp server), but I can't
figure out how to run both get_tweets.php and parse_tweets.php as a
background process like with SSH commands:
nohup php script.php > /dev/null &
Some of you started using (the Windows equivalent of) cronjobs, but
this isn't the right way to go. I think this is because of creating
multiple connection (or re-connections) to the Twitter streaming phirehose isn't allowed?
How can I run both PHP scripts (get_tweets.php and parse_tweets.php)
as a background process on my local WAMP server (and later on a VPS)?
Just to clearify:
I am using a WAMP server (first to test a little bit and later to
run it on a VPS)
Using LAMP or any *nix server/system isn't an option (due to time,
experience and lack of skills)
I have searched for solutions (on google and stackoverflow), but they are either not working or not clear enough for me (I am new to this)
Thank you in advance.
Find the php/bin folder where the php.exe is located. Copy the folder path and add it to your PATH environment variable (Follow this for instance to edit your PATH variable.
Once this is done, you'll be able to execute php in the command line from anywhere. Just start php script.php with a command line in the right folder and it should work. There might be some configuration to make so that the php in command line uses WAMP's php.ini.

Categories