Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. Are you running this over the browser or via cli? There are two (or more) different php.ini files. Make sure you are changing the proper one. If you are using fpm, you will need to restart fpm. Finally, if you are calling this from the browser, the browser itself has a timeout limit, which is part of the reason why you should be doing this on the CLI to avoid the 3rd party stuff getting in the way. You can also use set_time_limit to set the exection time in the script itself which will override the php.ini setting.
  2. This topic has been moved to Application Design. http://forums.phpfreaks.com/index.php?topic=365100.0
  3. http://forums.phpfreaks.com/index.php?topic=254277.msg1718540#msg1718540 READ NOwwwW Okayz?
  4. *premiso facepalms if ( ! empty($documents) && is_array($documents)) // added foreach($documents as $addFile) { $addFile = ltrim($addFile); Should do what you want.
  5. =\ I thought that was the whole point of this thread...
  6. Chuck Norris is the only known person to have successfully divided by zero.
  7. I want to divide by 0.
  8. if ( ! empty($documents) && is_array($documents)) // added array_walk($documents, 'ltrim'); foreach($documents as $addFile) Try it like that. Or like this: if ( ! empty($documents) && is_array($documents)) // added array_walk($documents, 'ltrim'); foreach($documents as $addFile) { $addFile = ltrim($addFile);
  9. Is $data[11] the item that needs trimmed? It seems like you are just exploding it. $documents = explode(",", $data[11]); array_walk($documents, 'ltrim'); Should do what you want, not really knowing what you want and thinking that you do not know what you want.
  10. ... you said it yourself, using trim. Not sure what you are trying to get at, without you pasting more code so we can see where the filename is being used / where the trim would need to apply. Alternatively, you could just apply it to the whole documents array using array_filter
  11. Also, you are using TCP for the php process, I do not think mod_php uses TCP, also what other modules for apache are configured? Something like mod_cache can skew the results as well without tuning Nginx to do similar as well as the mpm module.
  12. Not really comparable, maybe if you got nginx to use fcgi it might be comparable. But that alone flaws your data. There is a reason they call it "fast cgi" vs just "cgi".
  13. How did you run php? mod_php for apache I would assume, how about with nginx? How about trying both running php-fpm over fcgi and see what the results are for a better comparison? 1,000 hits is nothing, use the apachebenchmark tool and truly test with concurrent connections etc and see how each handle. You can also tweak, both nginx and apache, to do different performances etc. So you would need to also get those settings as close as possible to each other.
  14. Read higher up: Corruption of some router cables lulz
  15. I wonder if PHPFreaks is hosted on GoDaddy, seems to be going down often today!
  16. <?php //... code above this $types_array = array(IMAGETYPE_JPEG, IMAGETYPE_ANOTHERIMAGE); $badImg = array(); foreach ($_FILES['photoname']['tmp_name'] as $key => $iData) { if (!in_array(exif_imagetype($iData), $type_array)) { $badImg[] = $key; } } if (empty($badImg)) { // All files passed. } else { // there was an error and ids are in $badImg } Something like that should get you going.
  17. Apparently "Anonymous" has successfully implemented a DDoS attack on GoDaddy today bringing down all of their hosted websites due to GoDaddy's support of SOPA / PIPA in the past. http://www.cbsnews.com/8301-501465_162-57509744-501465/godaddy-goes-down-anonymous-claims-responsibility/ Hope you are not hosted by GoDaddy
  18. Storing something as big as a video in a MySQL database in inefficient to say the least and not recommended by any means. It would be better to store the video information (such as path to video) in the database and keep the video on your file system (IE inside of a folder on the computer). This will yield much better performance than putting it in the database and probably cause you a ton less headaches, such as MySQL being completely overloaded by 5 people trying to grab different videos at a time and locking up the database. Or a script inserting 1 video and creating a write lock on the DB.
  19. You can use Regex in MySQL. Mysql Regular Expressions But the more prudent question to ask, is why are there invalid emails in the table? I would fix that problem first, then clean the database out and or require an updated email for any invalid email when the user logs in (assuming they do login).
  20. From the link I posted earlier on: My bet is your editor is dishing out the Byte Order Mark Check your editor's preferences, or let us know what editor you are using so that you can be assisted to turn it off, re-save and see if that solves your problem. Alternatively, as also mentioned in that topic, you can turn on Output Buffering in Apache which will save all output to the end of execution and should prevent the error from occuring, although that is looked more of a bandaid, it still works.
  21. First up, you should re-work the query where you do not have to do the loop, that will kill your performance a ton. Second up, $r2 = @mysqli_query ($dbc, $q2);// or trigger_error("Query: $q\n<br />MySQL Error: " . mysqli_error($dbc)); Is suppressing any helpful errors that may be thrown. Remove the @ and see what errors are coming out of it.
  22. premiso

    Captcha

    My best guess is that it is referring to: imagettftext($img, 18, 0, 5, CAPTCHA_HEIGHT - 5, $text_color, 'Courier New Bold.ttf', $pass_phrase) Given that is the name of the function. So your "Courier New Bold.ttf" is most likely not setup in the directory you are calling the script from. Looking at the manual for imagettftext It would seem that the spaces in the font file may be causing the problem as well as the .ttf you added on.
  23. The only way to know is to check your error logs. Chances are it will be under the apache error logs. You can find out where they are set in the apache VHosts file, but generally should be under /var/log/apache2/error.log It should give you the correct error(s) which can help me help you.
  24. I see, I guess I was mislead by the code you showed, as you seemed to only try 1 file. Do you have more code to provide so I can more accurately assist you with what you want to achieve? Namely the loop portion of the code that iterates over the Photos.
  25. $types_array = array(IMAGETYPE_JPEG, IMAGETYPE_ANOTHERIMAGE); That is simple, replace your array code with the above (change the ANOTHERIMAGE to a valid type) and then: if (!in_array(exif_imagetype('image.gif'), $types_array)) {
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.