DevReview.net

More development notices …

Archive for the ‘php’ Category

Problem IP 127.255.255.255 in statistics

leave a comment

It could happen with some php-mysql scripts if you moved from 32-bit platform to 64-bit.

Quick fix for that – replace int(11) on bigint(20) in mysql tables.

Written by admin

August 7th, 2010 at 7:45 pm

Posted in mysql, php

Tagged with , ,

PHP exec() returns error 127

leave a comment

Today I had one strange error between php and freeBSD, throught exec() function. Had to debug for 2 hours.
User passed correct. `whoiam` returned right data. Some other shell commands like `ls -al`, `pwd` worked well. With same user direct command to shell worked correct.

but:
$command = "identify -format '%m' " . $src;
exec($command, $output, $result);

$result returned (int)127 error.
$output – empty.

Btw, `identify` is part of installed imagemagick’s application.

The problem was – php can’t find application `identify`. Dunno why even till now. So, full path works OK.

$command = "/usr/local/bin/identify -format '%m' " . $src;
exec($command, $output, $result);

cheers

Written by admin

March 14th, 2010 at 10:24 pm