Last Ditch Attempt To Prolong The Life Of A Dying RH9 Server
does anyone know where I can get php4.4 or php5 rpms (including all dependencies) for RedHat 9.
View Complete Forum Thread with Replies
Related Forum Messages:
Is PHP A Dying Language?
Most web jobs I see advertised are looking for programmers with .NET, JAVA or C/C++. Is there any point persevering with PHP when these languages are the future?
View Replies !
Script Dying...
I'm doing a script that is falling short before finishing. I have set_time_limit(0); I output an html comment every 10 seconds and it still doesn't finish running... Any ideas?
View Replies !
Script Dying At Include()
I tried to run a simple script today on my PC (WinXP, PHP5, MySQL 4.0.17) that I haven't run for about a year, and for some reason it's dying at an include() statement that used to work fine. I double checked to make sure the file is still there, and it is. The weird thing is, I'm not getting any type of error to tell me what the problem is. I tried include(file.php) or die (mysql_error()); but still got no error. I've had some other issues since I went to PHP5, so I tried going back to 4.3.9, but I still have the same problem. The exact same setup on my laptop works just fine, so I know it's something local to the PC. Can anyone give me a suggestion as to why my script would be dying at include()?
View Replies !
XML Feed Dying, How To Handle Gracefully
I currently have an XML feed that is dying, I am assuming because the site it's coming from is down. Anyway, I have an error statement that executes when it can't be open for reading, but how would I do error checking, that would ignore the error and display an alternative should the feed fail? PHP Code:
View Replies !
PDO Transactions Life Span
Do transactions automatically commit or rollback after a specific period of time? does mySQL close its connection after a specific time? or maybe PHP closes the connection? I've got quite a semi-complicated script that takes about 85 seconds to execute usually. This is due to it accessing remote files etc as that just adds time. Code:
View Replies !
Session Id In A Long Life Cookie
Okay, my session's cookie is by default set to destroy on session closure. I want to make this cookie last 30 days. the only way I came up with is to put: session_set_cookie_params() before every time I say session_start(). Is there an easier way to do this? something that I can do only once?
View Replies !
Real Life Examples Of Mysql+session_set_save_handler
In my test setup using my own session handlers with session_set_save_handler and mysql, the session handler opens and close mysql connections. But what if my page also requires some mysql queries? Should I open a new connection or use the already opened one (opened by the session handler)? I have made it a good practice to close a connection after a query but if I do it with only connection open no session data will be written to my mysql table. I have seen some scripts using persistent connections but are not sure what would be the best for a real world environment.
View Replies !
Hack Attempt?
I store all of the searches that are made on my website so i can identify what my customers want. One of the recent searches look like this Content-Transfer-Encoding: 8bit x-: 18938d774e16326063c819c92eea0050 Content-Type: text/plain Subject: to: censoredforpost@aol.com Sadly i only store searches in a tinytext mysql field so i am not sure if this is the whole attack. My website is using php so i figured that it was best to ask you guys as you would know wot attacks are used against php. It looks like this is an attempt to send an email can you tell me what type of attack this is? or what they are attempting if i am wrong?
View Replies !
Attempt To Compile PHP 5.2.0 With Mysql And Gd (2.0.33)
I had an install of php without gd, this seemed to work ok. I decided I would like to use the gd package with php. I have Redhat 3.0AS, and php 5.2.0, and gd-2.0.33. the phpinfo file looks like it has gd (shows up in info page). I get a failure running one of the gd functions: Fatal error: Call to undefined function imagecreatefromjpeg() in usr/local/apache2/htdocs/thumbnail_generator.php on line 42 That function is supposed to be ok in gd. I assume that I must start all over. What directory should I be using for --with-gd=/?????? I have tried the unzipped location (gd-2.0.33) where i do the ../configure, etc - the php config fails, saying it cannot find libgd.(a|so) (which is in .libs) or at times gd.h. I have used /usr/lib as well - seems everything fails in some form. I am using apache 2.0. How can I remove php 5.2, and gd, and start over "correctly". I followed the install and readmes for both php and gd - but no luck.
View Replies !
Login Attempt Problem
Im creating a script that logs users in. I want a part of the script that if a user fails to put in the correct credentials then it logs it in the database, it logs the time and the users ip. But, I cant think of how I would query the database for all the records with a timestamp 300 seconds old. So, I need a query that checks the database for records less then 300 seconds old. Something like: $timestamp = time() - 300; $ip = $_SERVER['REMOTE_ADDR']; // Query here that checks for the records where the timestamp is greater then 300 seconds on
View Replies !
Session Rejecting My First Attempt.
I am using sessions for my login page, it always rejects my first attempt and second attempt i con login with the same login details. although i placed session_start(); right at the top of my document, but still its the same.
View Replies !
Odbc_connect Fails & Returns 1 On Attempt
Curious to see if anyone has had a similar issue. - solaris 2.8, sparc - apache 1.3.31 - php v. 5.0.3 - using easysoft odbc drivers - using unixODBC - apache built with php and required odbc/easysoft/unixODBC libraries statically linked (some) - connecting to MSSQL 2000 the problem is with this code: // the $connect variable contains the full {DSN=blah;SERVER=blah;PORT... etc) $cnx = odbc_pconnect($connect, $uid, $pwd) || printf("ERROR CONNECTING<p>"); if ($cnx == 0) { printf ("unable to establish connection - $cnx"); } else { echo $cnx; $rs = odbc_exec($cns, "use db;"); odbc_close($cnx); } the odbc_connect will return the value of "1" to the $cnx handle. anyone ever see this? no errors are thrown (from program output, or apache error logs). the auth seems to work OK... when I change the pwd to something incorrect, the proper errors pop up. i'm new to php, is there further debugging that I can do? the MSSQL box is offsite and i won't be able to do detailed error analysis from it's logs. i 'trace'd the php command from the command line, which produced the same error, with the trace not really showing any fruitful details from the calls made. i guess this is more of a unixODBC or easysoft issue, but was just wondering if anyone has noticed this return type.
View Replies !
Fetch, Store, Process: My First Attempt
I've made it a long way and I've read a lot of manual pages and tutorials. Some of this code is mine and some of it I got from the manual pages, so it's a Frankenstein script. Believe me, if I could have found the code to do this, I would have taken it in a second. But I couldn't find it so I had to write and piece together something that would work. Sadly, this represents about 60 hours of work. The code below fetches a remote page, stores it, scans it for the desired text and then displays the desired text in a webpage. It also checks to see if the stored file is "old" and if so, updates the stored file. It "works", but I believe it could be more efficient and I'm sure I've made some very rookie mistakes. Code:
View Replies !
Can You Define A Variable Twice? (Attempt At CMS From Scratch)
I've been typing along in my free time trying to create my own CMS (Content Management System) from scratch. Just wanting to start with something basic. I won't bore you with endless amounts of code, however, I'll just get right down to my current minor issue I have not been able to fix my self. Code:
View Replies !
First Attempt At Uploading Image And Storing To Db
I am trying to upload an image, create a new file based on that image and then store the base64 encoded image data in a database. I dont really know where my code is going wrong so I will just display it below: The following code contains the script to process the uploaded file, the form to upload the file and then a few links to view the file from a php script called simpleimageviewer.php: Code:
View Replies !
Warning: Mcrypt Ecb(): Attempt To Use An Empty IV, Which Is NOT Recomm
how to properly use mcrypt_ecb? This is the piece of my code I'm having trouble with below. I've done quite a few searches but keep coming up empty on the proper syntax from start to finish. $key = "unlock"; $msg = " top secret "; $crypted = mcrypt_ecb(MCRYPT_LOKI97, $key, $msg, MCRYPT_ENCRYPT); $crypted = bin2hex($crypted); echo "$crypted";
View Replies !
An Attempt To Explain Sessions - PLEASE Correct Errors Where Found
This is stuff I've been arguing with recently and I think I've figured out how to get the crud to work right :-) session_start() sets up your session vars. As such, it must be called before the header is sent; in other words, before you start sending HTML. You can have 150 lines of php code, but as soon as you echo "<HTML>" you're hosed. session_register() will set up the variable passed to it to EVERY page that starts with session_start(), 'cause a session is a temp file somewhere (I think on your local machine) that is storing this, so until that file gets whacked or updated somehow, the variable is in there. Session_register can be used anywhere in your code. Session_register will NOT update if you try to give it a new value. Example: $var was passed from page1.php via session_register("var"); $var = bob; will NOT set $var = bob. $var is still registered as a session var, so when you echo $var, it still gets $var's value from the session. Also, it will not update if you send $var in the URL. So http://www.whatever.com/page2.php?var=bob will NOT work, as the session sets $var BEFORE the URL does. And of course, this also holds true for form data. Nice little security bonus, isn't it? There are a few things you can do to change $var: 1. session_unregister("var"); - this will delete $var from your session file. Then you should be able to declare $var again, and then session_register it again if you want. Note that session_unregistering will only remove the session file's entry for $var, but not $ar itself. So unregistering $var will keep it from passing it to other session-enabled pages, but it leaves $var set in the page you unregistered it in. You can then do whatever you like with $var. If you don't want $var to exist at all, you have to unregister it and then unset("var"); 2. session_unset(); will whack ALL session variables. 3. session_destroy(); will whack your session completely. So, if you want to set your session var to a passed var, i.e. page2.php?var=bob, you would do this:
View Replies !
Test Server To Live Server - Best Way Of Handling Different File Paths In Scripts?
I have taken over someone else's PHP code and am quite new to PHP. I made some changes and have implemented them to a live environment fine so far. However, I now want to setup a test environment. All the PHP scripts start with a few lines of: require_once "library file at specific location on server" and when I move them from the test location to live location I have to manually apply the changes to each script to reflect the different paths for each server. I was thinking of writing a small script that is contained within the same folder as any folder that contains scripts that actually calls another require for that server . E.g. Have script do_something.php which I am developing regularly. On live server it starts with require_once "/home/live/phplib/library.php"; On test server require_once "/home/test/phplib/library.php"; Currently I apply a manual change this (via global change or whatever) when moving from Test to Live However, I might just change all requires to: require_once "./require.php"; And then have a server specific version of require.php that contains the necessary requires for the particular server on which it resides. This way I can just change all the scripts to just require the require.php file in the same folder as itself. The actual PHP scripts where I do most of my updates need no changes whether on live or test servers. I just wanted to know if there was a better way of doing it then this. I know nothing about directives in PHP or if there was a way of determining the current server name and then calling different require commands appropriately.
View Replies !
Code Output On Home Server Differs To Hosted Server
I just installed Apache, PHP and MySQL (all apears to work ok) on my WinXP machine at home. Apart from a few notice messages, the script mostly ran fine, except one of the forms. I simplifed it to a minimum, but it still doesn't work on my home server (tho it does on my hosted space). PHP Code:
View Replies !
Php MySQL Works On Remote Server, Only Partially On Local Server
code to populate form select fields with data from a MySQL database, so a user can use those to sort/filter and view the 3,000 records. No inserts -- just selects; very simple. I originally set this up using URL-based query strings at http://stjuliana.org/school/ar/BUindex.php but since that only allowed sorting and not filtering, hence all 3k records load, I made a form verson at http://stjuliana.org/school/ar/index.php . Everything works just fine, however, there's still a lot of tweaking I want to do, such as splitting the form input and output into two pages (_blank), having a printable version, etc. To that end I just set up the latest builds of Apache, php and MySQL on my local Windows XP box, lest I blow my beer budget for the month on bandwidth overage. <g> I have a very simple page I used to test my localhost setup and everything's fine. I can connect to MySQL, create, insert and select from DBs, so I know my config is fine. All my other .php pages on this site work fine locally as well. The two abovementioned pages, however, are giving me fits when run locally... For the URL-query-string version, it loads up with the default view (=name_ns), which grabs all records and sorts by name and point asc. No matter which of the other sort 'views' I might choose, it still loads up all the records in that default sort. The server's holding on to something and I don't know how to clear it. The remote version correctly sorts based on the query string chosen. The form version is worse. It connects to the DB and populates the select boxes with the field data -- that part's fine. But no matter which submit button is selected, no data is retrieved. I get no error, but no data either. The form's action is set to $_SERVER['PHP_SELF'] and I've tried both GET and POST -- no change. Since the exact same pages work on the remote server I know it has to be something on the local setup. But where do I look if there's no obvious error? This is probably something incredibly basic but I'm bleary-eyed from reading tutorials and forums all over the Internet and can't come up with anything.
View Replies !
SMTP Server Response: 503 This Mail Server Requires Authentication
I get this any time I try to send an email to someone that IS NOT in the domain of the company: Warning: mail() [function.mail]: SMTP server response: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server. in corpevent.php on line 21 I have it setup like this (I removed the email address domain...but its correct in the code): // INI Settings // ini_set(sendmail_from,"info@domain.com"); ini_set(SMTP,"mail.domain.com"); ini_set(smtp_port,"25"); $headers = "MIME-Version: 1.0"; $headers .= "Content-type: text/html; charset=iso-8859-1"; $headers .= "From: info@domain.com"; $to = $_POST['txtEmail']; mail($to,"Your Email",$theEmail,$headers); Why am I not allowed to send an email to anyone that doesn't have a "domain.com" at the end of the email?
View Replies !
Script That Uploads A File To A Server And Then FTPs It To A Remote Ftp Server.
Basically I've developed a script that uploads a file to a server and then FTPs it to a remote ftp server. It was (as still does) work fine on my local testing server but since moving it across to IIS, when i run the script, now all I get is a blank page for anything but tiny files. I've tried increasing the values in php.ini that are associated with file uploads, yes I still get the blank screen.
View Replies !
Pages Loading From Test Server Then Online Server?
The one problem I am getting is that when I load up the website on my home server it loads in fine and then when I try to load another page it gets the page from the online website. It carries on with this alternating routine and I cannot find out why. Setup files appear unchanged and the only thing I have changed are some of the PHP files and after it started doing this strange thing, I copied the original files back to see if that changed anything but no difference was seen. I am not even sure where to look for this problem let alone put it right.
View Replies !
Passing A Value (eg Id) From A Apache Server To A Windows Server
I am trying to pass an Id from one server to another. The case is like this I have two scripts one in php and the other in asp. I am trying to combine the both together by passing an Id from php script to an asp script. The problems come on the client side because the information is on two different servers. Is there a way around this? Can this be accomplished?
View Replies !
Website/PHP App On One Server; MySQL DB On A Different Server - Feasible?
I just inherited an ASP site project currently running off of a Microsoft Access DB which I'd really like to convert to MySQL/PHP. The only problem is that the site's host only supports Microsoft Access and SQL DBs. MS SQL is simply not an option for us at this time and the site is getting enough traffic that Access's 10 concurrent connection limitation is going to start to become an issue in a hurry. This client recently renewed their annual subscription for hosting services from the aforementioned provider so switching hosts is not an option at this time. I'd like to convert the Access DB to MySQL and host the DB on my host's server while maintaining the asp/php site on the current host's box but am worried that it will dramatically increase the time it takes to process the asp/php scripts. It this sort of setup generally frowned upon? Is there any way of estimating script processing time without implementing the setup I've described and testing it thoroughly? I should mention that the script is a very basic "SELECT" query that simply pulls info from a database; it is nothing complex or extremely taxing resource, server or bandwidth wise. Am I completely off my rocker?
View Replies !
Doing A Server To Server File Transfer
I have two server. I am trying to copy all the files from one to the other. The problem is that there is 80gig to be copied - so I would like to send it from server to server without downloading and the uploading it again. Is there some way I can use ftp or mget or get or wget or something to move the files faster?
View Replies !
$ SERVER['SERVER ADDR'] Blank
What would cause the SERVER_ADDR $_SERVER variable to be blank? It's only happening on one server running PHP 5.05 on FreeBSD. And is there another way to get the IP of the server short of doing a DNS lookup on SERVER_NAME (which is there)?
View Replies !
FTP Big File Transfer From Server To Server
I am wanting to do a pretty big file transfer from server to server. The size is about 6 MB. What is the best way to do this using PHP? Would the normal PHP FTP functions transfer this? If so, How do a I make a progress bar so that I know how far it is?
View Replies !
Migrating A Site From A Server That Has PHP 4.2.2 To A Server That Has PHP 4.3.9.
I am migrating a site from a server that has PHP 4.2.2 to a server that has PHP 4.3.9. On the PHP 4.2.2 server getimagesize worked just fine, but on the PHP 4.3.9 server it does not work. Here is the code. PHP Code: list($width, $height) = getimagesize(rtrim("images/eventid_" . $row['event_id'] . "_images/" . $row['picture'])); echo $width . " " . $height . " width and height";
View Replies !
Development Server To Live Server
I am wanting to setup a development server where my PHP code will reside before it goes onto the live server. Anyone have any advice / tips on how to set this up and how to move the code from the development server to the live server.
View Replies !
Direct File Upload From User To SFTP Server "through" Web Server
I am writing a PHP application which requires HUGE files to be uploaded to an Akamai server. The obvious way to do this is to just use cURL or the built-in PHP FTP functions to upload the file to a temp directory on the Web server and then upload them to the Akamai host. However, we don't have enough room on our PHP server to have 1gb size files laying around so I want to see if there's a way for the PHP application to "broker" a transaction directly from the user's desktop to the Akamai servers. further, we need this to be secure, so it would have to use SFTP or SCP. I thought of using cURL to establish an upload stream, and then another process would just look for data in that stream and pass it on to Akamai, but this feels exceedingly "brittle". Pipes and streams are not the most robust things around and often close down unexpectedly--especially during a 1gb transfer of data. Has anyone ever done this? Any shortcuts, or hints as to what direction I should look?
View Replies !
Server To Server File Transefer Script, Getting Wrong File Size
Any help on this is most appreciated. I have created a function to download a file. It seems to work except the file sizes differ greatly. I start off downloading a 5mb .zip file and end up with a 2mb .zip file on the initiating host. Thanks for any advice on this. function get_http_file ($host_url, $http_file) { global $host_url, $http_file; $fp = fopen("$host_url/$http_file","rb"); while(!feof($fp)) { $my_file .= fgets($fp, 4096); } $fptmp = fopen("/tmp/$http_file","wb"); fputs($fptmp,$my_file); fclose($fp); fclose($fptmp); if (file_exists("/tmp/$http_file")) { $result_code = 1; } else { $result_code = 0; } return $result_code;
View Replies !
Internal Server Error The Server Encountered An Internal Error Or Misconfiguration And Was Unable To Complete Your Request.
I put htaccess code in my site "RewriteEngine On RewriteRule ^(.+).html$ index.php?mod=$1 [L,QSA] Redirect temp ErrorDocument 404 index1.php?mod=view-page ErrorDocument 500 "/errors//http-error.cgi" I used this coding.but i received "Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have used the error. More information about this error may be available in the server error log. " what i do?
View Replies !
Ftp Upload From Server To Server
I want to upload file from one server to another using some sort of php class or some another PEAR file? For now I have downloaded pear file from pear.php.net. It works great but when I want to send files to some servers I get an error. The script makes a file with 0(zero) bytes, and then I get a...
View Replies !
Download To Server From Server
I know it can be done, my method just don't work. And I cannot change my allocated memory amount. <?php $file = file_get_contents('http://www.thepchs.com/file1.zip'); $fileh = fopen('file1.zip', 'w+'); fwrite($fileh, $file); fclose($fileh); ?> I get Fatal error: Out of memory (allocated 35913728) (tried to allocate 35651584 bytes) in /homepages/0/d179649980/htdocs/sites/inlineproduction.com/zonew.net/vid/download.php on line 2 How can I do this where it does not put the file in memory.
View Replies !
|