I’m using a litte script to convert PDF to JPG. That works but the quality is very poor. The script: One more thing, I want to keep the original size of the PDF but the conversion crops the size of the JPG. Answer It can be done using setResolution, but you need to do it before loading an image. Try
Can I safely delete all content in /var/lib/php5?
I have over 5 million session files in /var/lib/php5 I would like to delete all files in this folder using rm *, however I’m not sure if there are other files other than the session files in that …
php-fpm and nginx session problems
I’ve been having this problem for the past week or so. I’ve been working on a PHP project that relies HEAVILY on Sessions. For some reason we’ve been having troubles with the sessions saving the past few days. Any idea why? Here’s the error: nginx version: PHP-FPM config: nginx.conf: A…
Can PHP cURL retrieve response headers AND body in a single request?
Is there any way to get both headers and body for a cURL request using PHP? I found that this option: is going to return the body plus headers, but then I need to parse it to get the body. Is there any way to get both in a more usable (and secure) way? Note that for “single request” I
PHP Error: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush
Could someone please save these 2 files and run them and tell me why I get the error ” ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush”. I tried googling around and it says that I have to use ob_start(); but when I do then it doesn’t print out line by line, but rather…
RabbitMQ and Yii console callback error
I am trying to get RabbitMQ working with the Yii console in order to send transactional emails, but I am experiencing problems with getting the PHP-AMQPLib library to work within Yii. My code is …
Using Default Arguments in a Function
I am confused about default values for PHP functions. Say I have a function like this: What if I want to use the default argument for $x and set a different argument for $y? I have been experimenting with different ways and I am just getting more confused. For example, I tried these two: But both of those do …
Check whether $_POST-value is empty
if(isset($_POST[‘submit’])) { if(!isset($_POST[‘userName’])) { $username = ‘Anonymous’; } else $username = $_POST[‘userName’]; } I cannot get the $username to be “Anonymous”?…
Get folder up one level
I am using this: echo dirname(__FILE__); which gives: C:UwAmpwwwmyfolderadmin However I am looking for path until: C:UwAmpwwwmyfolder from current script. How can that be done ?
Which version of php added anonymous functions
In manual there is create_function function and you can pass result from that function to array_map, I thought that that is the only way to have something like anonymous functions and closures, but then I found that I can just put function like in javascript In which version of php I can do this? Was this alw…