I have a database with a table of "Notifications" populated by a .php page located in a sub-directory of a domain I have hosted by Sonic.net. Inserting, updating, deleting etc of this Notifications table is working fine. Each Notification has a expiration DateTime field, and a Y/N field indicating whether or not it has been acknowledged. Now I need to have a task that periodically (every 3 to 5 minutes or so), checks if a Notification has either expired, or been acknowledged, and if not tries to send it again to the appropriate device(s). I was first going to do this with an EvTimer from PHP, and there would be one timer for each notification, and would exit after the Notification expires or is acknowledged. Unfortunately the ev.so extension is not available by default, I read the Sonic wiki about using a custom php.ini, and I built the ev extension from source, and tried to load it from a custom php.ini, but when I put the .htaccess file in the sub directory of the server (where the .php pages that updates the Notifications table is I could not access any pages in that directory.
I then thought having a cron jop run a PHP file and iterate over the Notifications table and re-send any that had not expired or been acknowledged, but I found that PHP files run from a shell terminal (as I assume would be the case when using a cron job), do not have MySQL, which kills what I'm trying to do.
*****************************
I was also confused by some of the instructions in the wiki:
It says to make the symbolic link to PHP5 in "~/public_cgi/php5"
and to copy the php.ini file to the same directory.
(I did not have a "public_cgi" directory in my home directory so I made one,
I also tried creating the link, and copying the php.ini file to the WWW_Pages
of my home directory neither of these worked)
Then the instructions say " In your .htaccess file replace the reference to /cgi-bin/php5 to be the one you just created in your own cgi directory, i.e."
and gives the following example:
AddHandler php-cgi .php
Action php-cgi /cgi-bin/USERNAME/php5
I tried replacing "cgi-bin" with "public_cgi" and "WWW_Pages" neither of which worked.
Soooo .... I either need some more specific/correct examples of how to use a custom php.ini (asuming I can load a custom extension (ev.so) that way), or a way I can run a php file which can execute mysqli commands from a cron job.
Thanks,
Robert Young
I then thought having a cron jop run a PHP file and iterate over the Notifications table and re-send any that had not expired or been acknowledged, but I found that PHP files run from a shell terminal (as I assume would be the case when using a cron job), do not have MySQL, which kills what I'm trying to do.
*****************************
I was also confused by some of the instructions in the wiki:
It says to make the symbolic link to PHP5 in "~/public_cgi/php5"
and to copy the php.ini file to the same directory.
(I did not have a "public_cgi" directory in my home directory so I made one,
I also tried creating the link, and copying the php.ini file to the WWW_Pages
of my home directory neither of these worked)
Then the instructions say " In your .htaccess file replace the reference to /cgi-bin/php5 to be the one you just created in your own cgi directory, i.e."
and gives the following example:
AddHandler php-cgi .php
Action php-cgi /cgi-bin/USERNAME/php5
I tried replacing "cgi-bin" with "public_cgi" and "WWW_Pages" neither of which worked.
Soooo .... I either need some more specific/correct examples of how to use a custom php.ini (asuming I can load a custom extension (ev.so) that way), or a way I can run a php file which can execute mysqli commands from a cron job.
Thanks,
Robert Young