Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Why Script Runs Differently With CRON?


I am running a PHP Script that downloads my RSS News (and the accompanying Thumbnail images)from the Web. When I execute it from CMD line, no problem. The News and Images are downloaded, great!

When I begin to update via CRON, no images are downloaded/written to disk.--I don't have this problem when it's RUN from a shared hosting account, it's only on my home Linux Box.




View Complete Forum Thread with Replies

Related Forum Messages:
Way Of Returning Something Differently??
I have created a table with one of the columns being a datetime column.nOnce the date and time has been collected off of the person submitting, i would like to show the date and time in the way of:
Dec 22 2000 22:09:01
Is it possible to do this via PHP rather than it outputting the usual:

View Replies !
Printing Time Out Differently
I have hosting on an American server, but me being in good ol' England have slightly different time here to that of the server. When i post an entry for datetime, using NOW(), into the MySQL database, it obviously puts the server time down.
I wish to be able to add 5 hours on to this without changing all the existing posts times.
Is there any way of doing this through the mysql query or some other way?

View Replies !
How The Safe And Cgi Modes Act Differently.
I was reading about permissions in PHP and how the safe and cgi modes act differently. Particularly about not having to CHMOD 775 because in cgi PHP has owner level privileges.

how are they different?I read about it in the manual,but it was confusing and I only understood some of it.

View Replies !
Content Showing Differently
My code is behaving differently based on whether the www is included in the URL or not.
Is there a way to get the code to display the same way regardless of whether the 'www' is in the url or not. My first inclination is to use some kind of header command in php but don't know if the search engines frown upon redirects.

View Replies !
Time - Echoing It Back Differently
I have a datetime column setup in a mysql database. My web host, which i based in Hawaii, has a different time zone to that of mine over her in good old England. I was wondering is there a way of echoing out the time from the datetime column but adding on 9 hours more?? Or even would it be easier to submit the data into the database with the time difference?

View Replies !
Mail Function Behaves Differently !!!
My php code contains a mail function which sends mail with predefined hard coded values.

The problem is it works in my organization and when i run it in home is get this error

Failed to connect to mailserver at "mail.hackerresist.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

Please note that the code works in my organization but not in my home !!!

View Replies !
Returned Values Displayed Differently?
I've got a function in PHP that calls values from a MYSQL DB, and it returns numbers. (eg. - Woolyg - 14)

Is there a way in PHP to substitute these numbers for worded values? So say if the function returned values 1-10 it displays the word 'Useless'... 10-20 displays 'Average'... and 20-30 displays 'Awesome'..?

View Replies !
Php Script Behaves Differently When It Run In Command Line
I found that the php script behaves differently when it run in command
line rather than runing over web server.

Program includes the code like:

<?php
function send_email($from_address, $to_address, $bcc_address,
$subject, $msg, $attachments,$reminder_id) {
$headers = ...;
....
mail($to_address, $subject, $msg, $headers);
...
}

#main body of code here to grap info from database and call
send_mail() function here
...
send_email($newarry[FROM_ADDRESS], $newarry[TO_ADDRESS], $newarry
[BCC_ADDRESS], $newarry[SUBJECT], $newarry[BODY],$attachments,
$newarry[ID]);

?>
I can not use lynx since it doesn't support https on my machine.
The values are from database and feed in send_mail() function which
will form the body message and header and pass to php mail()
function. The problem is that "mail($to_address, $subject, $msg,
$headers)" can not access the values passed over to it when i use
'php' command to run the script. But I can use 'print' to print out
all the values but mail()function just can't get them.
However, this program works fine when I use broswer to access it.

View Replies !
MSIE Vs. Mozilla: $_POST Handled Differently?
I am building a form w/ multiple pages. For the sake of brevity, I was hoping to not have to pass values from each page to mysql for each individual page, but rather just string the values along as <input type='hidden' ... > until the entire form had been completed.

What is odd is that, in taking the values from $_POST, my PHP code works flawlessly in Mozilla, but does not function properly in MSIE 6.0. How could that be? Is it even possible that MSIE and Mozilla would handle $_POST differently? Or, is it possible that there is something else at work here... ?

View Replies !
Sessions Behaving Differently With Windows And Mac Browsers
I am having a strange issue with retrieving variables that i've stored in a session.

Basically im set up using the Xampp package, doing development on a powerbook, and using a Red Hat system to serve the pages. It's a online business card designer. Php 4.3 something and apache 2.0 on both. I am using the default session behavior and no custom handlers and not using global vars. Code:

View Replies !
Script Executes Differently When Triggered Remotely
I have a PHP script that is triggered by a .forward file when incoming email arrives. When triggered, the script retrieves the email using the php imap functions, processes the email, and then deletes it and empties the inbox before exiting. This setup worked fine whether the
script was triggered by an incoming email or manually via shell.....

View Replies !
Double And Single Quoted Strings Are Handled Differently By PHP
According to zend.com

Double and single quoted strings are handled differently by PHP. Double
quoted strings are interpreted while single quoted strings are treated
exactly as written. For example:

$foo = 2;
echo "foo is $foo"; // this prints: foo is 2
echo 'foo is $foo' // this prints: foo is $foo
echo "foo is $foo"; // this prints: foo is 2 (with a new-line)
echo 'foo is $foo' // this prints: foo is $foo

I can not get this to work.

View Replies !
User Runs PHP
I have an app that uses PDFLib to read some images off the file system (Red Hat linux) and puts them into a PDF. I have permissions set on the directory to be readable by the owner and the group, 'images'.

I made apache a member of the group 'images' but get a permission denied error when trying to read an image from the images directory. Is there some other user that owns the PHP app.

Env.
PHP 5.03
Red Hat ES4
Apache 2.02

View Replies !
PHP Only Runs From Command Line
I know very little about PHP, but I was just curious to know
why exactly would some PHP code run fine from the command line but not
from the browser?

I'm just curious. I was working with someone else's PHP code that
supposedly created MySQL tables in a database and for some reason it
just wouldn't create the tables at all (no specific error message).
Someone suggested I run from the command line and when I did, it
worked...

View Replies !
Cleaning Up After A Script Runs
how do you clear all varialbles and arrays after a script is run?

View Replies !
Bad Query Runs With No Error!
there must be some weird setting on the mysql database i am using for this latest project. the following query runs without throwing an error:

SELECT start_time, last_access_time, user_ip session_data FROM demo_sessions WHERE id='b31fd40c7e9135f2b52e4f17c23fc3c54da137b8'

notice there is no comma between user_ip and session_data

what's the story here? seems like a real security risk to me because my server won't log bad requests.

View Replies !
Bug 23891 MySQL Runs Out Of Connections
http://bugs.php.net/bug.php?id=23891

According to this report, what the person was asking isn't a bug, it's
a feature (rimshot).

I'm running into this problem almost exactly, and really don't
understand what the answer is. The support person snidely suggests
reading the manual, which is always great advice, but in this case
really doesn't help out.

Could someone explain what "If you use mysql_select_db() or slightly
different connection string you can have more open connections then
you have process." means?

If I don't use mysql_select_db, then what do I use?

View Replies !
EXEC() Runs Process In Background
Exec, shell_exec, system, popen functions all run the process in the
background.
how can i get it to run the process normally.
my code looks like this:
<?
exec("batch_file.bat");
?>

am i doing anything wrong?

View Replies !
Close Window After Script Runs
When a user clicks on a link in their email, I have a browser window that opens in the background and runs a script confirming their desire to be added to our email directory. I basically want this window to open, run and then close without the user having to deal with it.

Is there a way in PHP to close the window after the script finishes running in it? Or should I revert to JavaScript? I want the script to be mobile so I've sort of ruled out processing it server side. TIA.

View Replies !
How Often Does Garbage Collector Runs In Sessions?
Does anybody knows how often the session garbage collector checks for expired session to delete them? is it possible to modify this timeframe? is it possible to call this function manually?

I am storing my sessions in a mysql database and i am using a session expiration of 5 seconds (just for testing), but after the session is expired the session record in the db table still exists.

and it looks the sessions aren't expiring either because if you still have the session cookie you can keep up with the session. Code:

View Replies !
Email Form Which Runs From An Iframe
I have set up an email form which runs from an iframe. The only problem is that when the script redirects the user to the success or error pages, these pages open within the iframe. Is there a way to specify the target window as 'parent'? Someone said that this could not be done via the php script and would have to be done with javascript in the html form itself.

View Replies !
Optimizing Query That Runs Slowly On Linux
I was wondering if anyone has any insight into why the query I have posted below runs exceedingly slow on my Linux server. I am using Php with a MySQL database. On both my development computers the query runs briskly. They are however both Windows boxes, one running Windows XP and the other running Windows 2000 Professional. Here is the culprit.....

View Replies !
Counter - Increased By One Everytime The Loop Runs
i want to make a counter that i can echo. its going to be used in a while loop so i want it to be increased by one everytime the loop runs so each time it runs it would look like this:

counter=1
counter=2
counter=3
etc.

View Replies !
Php Script Auto Runs At Specific Time?
Is it possible to have a php script automatically execute at a certain time without having to visit the page or manually executing the code?
For example, execute test.php every hour?

View Replies !
Switch Statement That Runs Through Cases Numbered 1-100:
I have a switch statement that runs through cases numbered 1-100:

What is the most optimal way to run this switch?

switch($a){

case 1:

case 2:

...
}

View Replies !
MySql Is Loaded When Runs From Command Line, But Not Through IIS
Sorry for the newbie question, but I've been searching and searching and
haven't found an answer to this one yet.

I installed PHP and MySql (both latest versions) yesterday on a machine
running Windows 2003 Server with IIS6. Code:

View Replies !
How Do I Create A Link That Runs A MySql Query When Pressed!!
I Want To Create A Link, And When You Press That Link It Runs A MySql Query.

View Replies !
Header Function Runs Before Update To Database Is Made
I have been having some problems with a part of my login script. This is the two lines of script I am having problems with:

mysql_query("UPDATE " . $userName. " SET login = '$loginIN' WHERE pass = '$password' AND course = '$courseID'");
header( 'url=http://www.somewebsite.com/logged_IN.htm' );

The problem is that when this php script is executed the second line executes before the first and an update to the database is not made. I also tried the script without the second line and the first works then.


View Replies !
Query Runs In Mysql But Returns Error 1064
The same query runs in mysql and in Zend interface but not runs when using inside php script. I am receiving the error:

"1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near
'str_qry_Insert' at line 1"

INSERT INTO fnd_script_type (type_name) VALUES ('test1')

I already have tried it with as:

INSERT INTO `fnd_script_type` (`type_name`) VALUES (`test1`)
INSERT INTO fnd_script_type (`type_name`) VALUES (`test1`)
INSERT INTO fnd_script_type (type_name) VALUES (`test1`)

what am i doing wrong ?

View Replies !
Query Runs Multiple Times Under Heavy Server Load.
I have been having an issue with some MYSQL queries running multiple times when the server is under a heavy load. 

Example, if I do an 'update Table1 set item1 = 0 where 1 = 1'

This runs fine under normal conditions, but will repeat itself multiple times when the server is under load.  Is this just an optimization or server resource issue.  If so, I would assume the query would just timeout and not run at all instead of running a few times.

View Replies !
POP Account Creation Script On CPanel. Runs Fine On Win2000, Not On Linux.
I am facing a weird problem. This is a POP account creation script. If I run it from my Win2000 PC, it creates the POP account. But when I run this script from the Linux server (CPanel is also on that server), it does not create any POP account.

View Replies !
Working With Dates - Runs And Queries The Database To Produce A List Of Information
I have a script that runs and queries the database to produce a list of information, based on a date range. This is to fllow up on a script that is automatically run each Sunday night.

What I want to try and acheive is, for example, if someone manually runs this report on a Tuesday the script will assume that it is run on the Sunday night, to make sure the results are exactly the same as the emails that have gone out. PHP Code:

View Replies !
"Please Wait" Page While Php Runs Mysql Queries
Does anyone have any idea what I should google to create a "splash page" that tells the user to wait while a few mysql quieries are run through the php page?  It takes anywhere from 5 to 20 seconds, and I don't need a progress meter, just a splash page so they do not go anywhere and the user doesn't think there is a problem with their browser or network connection.

View Replies !
Help With Cron
I need some help with starting to use cron to auto update one folder from another folder remotely. I have no idea where to go and can't find a good tutorial or book on it, anybody have suggestions.

Eventually, I want to use one of my websites to update the pagtes on another, the hosting company won't set it up on the server for me so I need to develop a script i can run in php.

View Replies !
Cron Job Help!
I've been reading around with this but can't seem to find an easy example! I have NO idea how this works at all.

All I want to do automatically dumb the database to an email every morning at 4am, I know this IS possible but other than knowing I have to use cron, or cronjob.

Any help, or simple script showing me how this works would be much appreciated, I'm on PHP3 atm, but am moving to a new PHP4 server shortly.

View Replies !
Php Cron
Is there a way whereby when the cron I've set start to execute a particular command, while when the command gets back a positive response, it will stop the cron from running anymore?

For example:

cron start => execute command => 1 = true; 0 = false;

if 1, stop the cron completely from running anymore

if 0, continue to run as schedule in the cron file.

Another question is:

How many cron file can one server have?

View Replies !
CRON
I am just starting messing with CRON. I can set up a cron job to run a php
script each hour, but I have several web sites on one server that may need a
script running.

I was contemplating running one "manager" script each hour that would check
a mysql table and where necessary run one of a range of possible scripts,
probably one at a time to spread any load.

1. Is this the best way of doing this?

If yes, what fields do you recommend? (id, ref, scriptURL, timestamp,
active(1/0))

Is it worth creating a log file to keep an eye on what and when scripts have
run?

View Replies !
Set Up A Cron Job
I am looking to set up a cron job using PHP... I need a script to set up a cron job on the server to send out a blast email.

View Replies !
How To Set Up A Cron Tab?
Does anybody know how to set up a cron tab?

View Replies !
Cron And Php
Im trying to execute a php file at intervals using cron. if i call the file from my web browser it runs fine , but if i setup a cron job in cpanel , when the script runs , it just emails me a bunch of errors. is their anyway i can make this happen with cron?

View Replies !
Php Cron Job
how to do cron job in php I need to send email at pparticular time in some day , how to do that one.

View Replies !
Using Cron
I am working on a project. My project requires me to run a script everyday to query data but I don't really know if it is possible and how it is done inside the cron menu in Cpanel.

View Replies !
Php And Cron
I have a page with an expiration date on it along with some other variables. Then I have a script page to check that page to see if it has expired by checking the date function on my server then email if it is.

I have set up cron on my server to run the script page at a certain but when i get the cron email it tells me that there is a Syntax error: newline unexpected. I dont understand this because without cron just by opening up the script page it works just fine. Can someone help explain this to me please?

View Replies !
Run Cron
Code:

0 7 * * * cronlog "/usr/local/bin/php wget /var/www/html/fantasy_baseball_rankings/admin/getinjuries.php"
0 19 * * * cronlog "/usr/local/bin/php wget /var/www/html/fantasy_baseball_rankings/admin/getinjuries.php"

I'm trying to run these two scripts via cron at 7 AM and 7 PM.

View Replies !
Cron Job
I'm trying to create a cron job that deletes the database tables and then restores them automatically using a cron job. What I want to know is how would I insert the SQL commands to enable that restoration process to occur from the .sql file from phpmyadmin. I could just use the sql file in phpmyadmin but I want to do it automatically every few hours. And I have read many many questions similar to mine and the anwers were to use SSH, I don't have access to SSH on my server.

View Replies !
Cron Tutorial
anybody now good tutorial on cron??
thanks

View Replies !
Cron Daemon
does anyone know of any good tutorials on using the cron daemon to set up scheduled tasks?

View Replies !
Set Up Cron Jobs
I have to set up some cron jobs but I don't know anything about them, is there a place that someone knows of where i can learn about them? or tell me how to do them?

another question, i'm also trying to set up a search for my site...how do u split up a sting so you can search for each individual word? for example if someone does a query for "billy boy", how do i split up the string so it can search for both words, "billy" and "boy", instead of just "billy boy"?

View Replies !
Setting Up A Cron-Job
I need to setup a cron-job through a PHP Script.

If anybody does know how to do this through php script.

View Replies !
Non-Cron Crons
I need to 'run' a php script on a scheduled basis (i.e. hourly). However, my hosting company doesn't allow crons and the like.

My alternate strategy is to have my pc dial up and call the controlling php page. Does anyone know of a scheduling/dial-up utility (which will run under NT) that will help me achieve my goal? Or any other methods?

It's been suggested that I let visitors trigger the script, but the script processing may take some time and annoy the user.

I realise this isn't strictly a php question, but was hoping others might have found themselves in the same situation as myself and now have a solution.

View Replies !
Cron Running PHP
what would a cron command look like that runs a specific PHP script every hour?

View Replies !
How To Run A PHP Script Using Cron Job?
I am doing a application using WAMP. In a certain step i need to run
some php script using cron Job. But i don't know how to configure the
cron job in windows. I also don't know how to configure cron job in
Linux.

i search Internet but i failed to configure that. So i need a simple
configuration tutorial from our Experts.

Example:
1). i have a script named "test.php"
2). i have a DB Backup Script "dbBackup.php" and i need to run this
script daily at 23:58:00 time.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved