
section31
Members-
Posts
335 -
Joined
-
Last visited
Everything posted by section31
-
I can't get ImageMagick to work on server49 anymore. It was working just a few days ago, and now it doesn't. I have several accounts with you all and the same scripts work on server23 so i'm almost sure its not my code. I've already submitted a helpdesk ticket and they replied saying nothing is wrong with image magick and recommended I post my problem here. Ok, so check this out. ><? echo shell_exec('whereis convert'); // Where is the path to convert/imagemagick echo '<br />'; echo shell_exec('convert -version'); // What is the version of imagemagick running exec('convert image.jpg -resize 50% new.jpg'); // Create a new image half the size of the original ?> Both of these are in a directory thats chmodded to 777. On server 23, everything works fine. It outputs both the pathname and version and it creates the new image. On server 49. It outputs the pathname, doesn't output the version and doesn't create the new image.
-
I'm sorry. Yes, I meant server side parser. Not aggregator.
-
thanks david. Any recommendations on an xml aggregator? The pear class I'm using is bloated? I need a very basic one, it doesn't even need to support attributes. Edit: Oh, and i'm looking for one thats not event based.
-
Am I correct in assuming when people want to make an xml document for rss or whatever reason, they just grab the contents from their database and manually start building the xml structure and just echo it out with an xml header or write it to an xml file? I've parsed xml before using some pear class, but I've never made an xml document before and just want to make sure I'm not doing something wrong.
-
Wow, thats what i get for not reading that article entirely. Makes sense now.
-
Just an update. I just finished testing out some of my scripts using ab, the apache benchmark utility and while i was running ab I would run top on the server to check memory usage and cpu utilization. Suffice it to say, i was unable to determine if one particular script was more efficient than the other. The results were varying too much. However, just using ab for execution times did give me something to start thinking about. For example this code, which would you think would be more efficient. >// ############## Which is more efficient #################### // ############## USING echo and keeping the data in the buffer #################### ob_start(); for($i=0; $i<1000; $i++) { echo 'Very long STring'; } $test = ob_get_contents(); ob_end_clean(); // Misc Code here echo $test; // ############## OR just storing this in a variable #################### $a = null; for($i=0; $i<1000; $i++) { $a .= 'Very long STring'; } // Misc Code here echo $a; Using ob_start ended up being faster, yet I thought they would be the same. Don't they both use the same amount of resources, so why is the one using ob_start running faster? Here is the same benchark run only once. http://section31.us/scripts/bench.php Source: http://section31.us/scripts/bench.phps Oh, and if you're asking yourself how much faster. on ab, i ran 100 requests, with 10 connections, and it comes out to 15-20% faster. This is really sad considering i've been using the other way for the whole year and a half i've been using php.
-
hey raul, so i installed that trial version of zend studio and i'm looking at the profiler right now. It doesn't look like it does stuff thats comparable to ab. Run a script an X number of times on an X number concurrent connections while monitoring the servers resources. Now that I have apache installed on my windows box..I wonder if there is a way I can use ab on windows.
-
thanks, i'll check out the trial version.
-
Does anyone have any tips on benchmarking php/mysql scripts. The best idea I found was to make my own linux/apache/mysql/php server and run that ab utility... Is the best and only way? Timer scripts are only good to test speed, not so much for efficiency. Found the info about in this article. http://www.phplens.com/lens/php-book/optim...bugging-php.php
-
I just realized I could use subqueries, but we don't have mysql version 4.1 yet. So am I pretty much stuck with 3 queries?
-
ok, well thanks anyway. Anyone else out there know how I can do this in less than 3 queries?
-
Ok, take this as an example. http://section31.us/temp/new/section31/index.php?id=2 To do this, its really sad. I'm using 3 queries and I want to cut it down. This is what my 3 queries look like. Color Coded. >$image = mysql_fetch_assoc( mysql_query("SELECT * FROM images WHERE id = '{$_GET['id']}' ") ); $prevImage = @mysql_result( mysql_query("SELECT id FROM images WHERE time < '{$image['time']}' ORDER BY time DESC LIMIT 1"), 0 ); $prevImage = $prevImage ? '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $prevImage . '"><< Back</a>' : ''; $nextImage = @mysql_result( mysql_query("SELECT id FROM images WHERE time > '{$image['time']}' ORDER BY time ASC LIMIT 1"), 0 ); $nextImage = $nextImage ? '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $nextImage . '">Next</a>' : '';
-
For the record, I've disallowed some of my directories shortly after they were indexed by googlebot and slurp. It's been about 5 months, and they are still indexed. I'm guessing it takes a really long time for those indexes to expire.
-
whats the best way to do a prev/next script that cycles through images...would that take 3 queries? 1 query for the image, the 2nd query for the one after that, and 3rd query for the one before? I've used several pagers out there, but none I know of would work for this Requirements: Images are going to be accessible via the primary key in the database. So a call like this index.php?id=5 will bring up image 5. Then I would like the script to check if a previous image exists before that by date, and if it does show prev button, else fade out or unlink prev button. The same goes for the next button. How can I do all of this in under 3 queries?
-
Wow, I think it worked...so far so good. For some reason I didn't even think about changing that parameter. Thanks a lot David. If the problem recurs, I'll let you know
-
Has anyone ever used xmlhttp before? I'm trying to make a simple GET request and then refresh the current page. I know thats not really what you're supposed to do, you're normally supposed to grab the returned contents and use it somewhere on the current page. Nevertheless, the code i'm using is as follows. > xmlhttp.open("GET", url, true); xmlhttp.send(null); window.location.reload(); This code works most of the time, but every so often the request doesn't get made before the page reloads. Any ideas on how I can get something like this working 100% of the time. Here are some of the sites i'm looking at. http://www.web-design-forum.com/article_554 http://jibbering.com/2002/4/httprequest.html
-
Ok, I just finished trying it with 4.3 and still no dice UPDATE: David, you're not going to believe this. Guess what I did to get it working. I restarted my computer... Why in the world did I need to restart my computer? Oh well, Thanks for all your help.
-
hm, so it works on your machine huh. Forgot to mention, what version of php are you running, I'm running 5.
-
Thanks for the reply, Well, I'm not running drupal, but I tried the function anyway and I got the same results. You wanted to know the exact script i was running. I started off really basic and simple , and like i said earlier I tried it on the cmd prompt first to see if it would work first and it did. ><? echo 'Begin <br />'; // I tried all the flavors of php's program execution functions, (backticks, system(), etc) exec('convert E:\Website\test.jpg -resize 50% E:\Website\new.jpg'); // I also changed the paths from absolute to relative, still nothing. echo '<br />Done<br />'; ?> Remeber, I also tried using other things in my system32 folder through exec and they all worked. For example, I tried ><? exec('ipconfig'); // This returned the correct stuff ?> So this negates the possibility that the exec functions are disabled or aren't working properly because safe mode is on or whatever. I just don't understand how image magick's forums can't answer one of the most fundamental question there is. How do I get image magick working through php with a windows apache box.
-
I'm messing around with this on my personal windows box for fun and I can't seem to get ImageMagick Working. Has anyone ever installed imageMagick on a Windows Apache Server? I installed the binary, made sure it worked through the cmd prompt, then tried accessing it via a php script using one of those program execution functions like exec(), and the script doesn't do anything. No Errors, no warning, just continues with the rest of the script and stops. The exec function works just fine using other exe's in my windows/system32 directory, so I know its not that. Anyone have any ideas? NOTE: I've also posted this question on their forums, and I received not one reply
-
Just got this settled through the help desk. I have no idea why you guys have access to your domlogs and I don't. The tech had to change the path of the domlogs to my home directory for me to access it. Oh well, its all good now.
-
Yup, your script looks like it will work nicely. Thanks
-
Yeah I did add the tld. I'll go ahead and submit that help desk ticket in a while, but do you happen know if the log is for current month only or is there a place to access daily logs too...Just curious.
-
I know this is what I did. ><? $file = '/usr/local/apache/domlogs/mydomain'; header('Content-type: application/force-download'); header('Content-Transfer-Encoding: Binary'); header('Content-disposition: attachment; filename="'.$file.'"'); readfile($file); ?>