php-general Digest 9 Sep 2007 05:40:05 -0000 Issue 5008

2007-09-08 Thread php-general-digest-help

php-general Digest 9 Sep 2007 05:40:05 - Issue 5008

Topics (messages 261838 through 261863):

Re: Reg.Photo Upload Tool
261838 by: Børge Holen

Image Conversion...
261839 by: Tony Di Croce
261844 by: cajb
261853 by: Kevin Waterson

Re: LAMP Server setup help
261840 by: Randy Patterson
261841 by: Børge Holen
261842 by: Børge Holen

Re: Image Conversion... OT!
261843 by: Børge Holen
261845 by: Vidyut Luther
261846 by: Børge Holen
261847 by: Vidyut Luther

Can't execute PHP script
261848 by: Randy Patterson
261849 by: Børge Holen
261850 by: brian

Buxa Coding Guidelines
261851 by: magoo
261855 by: tedd
261856 by: Kevin Waterson
261860 by: Greg Donald
261862 by: mike

Re: html2png
261852 by: Kevin Waterson

pdo_mysql segfault error
261854 by: Slith

Re: Converting PHP code to C#?
261857 by: Symbian
261861 by: mike
261863 by: Symbian

Pack function in C#
261858 by: Symbian

zlib.inflate vs. gzopen/fread
261859 by: Gregory Beaver

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
---BeginMessage---
On Friday 07 September 2007 12:07, Ramesh.b wrote:
 Thanks Jay,

 I want a client side tool , something similar to Yahoo photos or flickr,
 where it will shrink the size of the image and upload.

You'd be better of makin' one yerself. Last time I got some questions about 
fileuploads and checked out yahoo for a friend, maby I don't remember 
correctly but didn't I actually see flash as a frontend.
Who would want such a thing. None've us with a ppc-arch anyhow


 Thanks
 Ramesh
 Jay Blanchard [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 [snip]
 Any opensource or PHP applicaiton is available for Photo upload tool?.
 [/snip]

 Easy to do yourself
 http://us2.php.net/manual/en/features.file-upload.php
---End Message---
---BeginMessage---
I need to convert (resize, and store as blob's in a mysql db) images my
users can upload. I'm wondering what the best conversion tool is... I'm
considering ImageMagick... Is this the best?

Is their anything that is integrated with PHP itself?

  td
---End Message---
---BeginMessage---
On 9/8/07, Tony Di Croce [EMAIL PROTECTED] wrote:
 I need to convert (resize, and store as blob's in a mysql db) images

avoid that for no further problems.

 ImageMagick

you can use this tool for your needs.


-- 
Romanul s-a nascut poet. Trebuia sa se nasca neamt!
---End Message---
---BeginMessage---
This one time, at band camp, Tony Di Croce [EMAIL PROTECTED] wrote:

 I need to convert (resize, and store as blob's in a mysql db) images my
 users can upload. I'm wondering what the best conversion tool is... I'm
 considering ImageMagick... Is this the best?
 
 Is their anything that is integrated with PHP itself?
 
   td
 

http://phpro.org/tutorials/Storing-Images-in-MySQL-with-PHP.html


-- 
Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote.
---End Message---
---BeginMessage---
On Saturday 08 September 2007 12:20, Børge Holen wrote:
 On Saturday 08 September 2007 10:07, Randy Patterson wrote:
  Hey,
 
  I have setup a test system on my home network in the past to develop 
  test PHP apps by installing an ISAPI PHP dll in IIS. It worked great but
  now I trying to setup a LAMP server on Debian/Lenny. I ran the following
  command;
 
  aptitude install apache2 php5 libapache2-mod-php5
 
  But got the following error message;
 
  Setting up apache2-mpm-prefork (2.2.4-3) ...
  Starting web server: apache2apache2: Syntax error on line 187
  of /etc/apache2/apache2.conf: Syntax error on line 3
  of /etc/apache2/httpd.conf: Cannot load /etc/apache2/modules/libphp5.so
  into server: /etc/apache2/modules/libphp5.so: cannot open shared object
  file: No such file or directory
   failed!
  invoke-rc.d: initscript apache2, action start failed.
 
  The error is pointing to this line in the httpd.conf;
 
  LoadModule php5_module  modules/libphp5.so
 
  But this directory or file don't exist in the /etc/apache2 directory.
 
  Not sure how to fix this. I'm a newbie when it comes to the LAMP server
  apps. Any help would be appreciated.

 Seems very much like some missinformation of some kind.
 Apache2 should not use any modules/  directory.

 Apache2 uses symlinks to enable modules, check if symlink exists.
 In the directory mods-enabled there should reside syms like this:
 php5.conf - ../mods-available/php5.conf
 php5.load - ../mods-available/php5.load

 Any other php relations within both httpd and apache2 conf is to be
 removed. It does not complain over missing php libs, it complains 

Re: [PHP] 'application' variables not available? Alternatives?

2007-09-08 Thread david
Thanks very much for that Vidyet. This is going to be a massive help.


Vidyut Luther [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi David,
 I'd say your best bet is to use memcached. This will allow the
 variables you specified to stay in memory, and be accessible to all
 other applications.

 http://www.danga.com/memcached/

 Keep in mind though, just because ASP does it in one way, you don't want
 to do a bit for bit copy. You could also look into options like the
 auto_prepend feature in php.ini, and the define() function.

 http://us2.php.net/define

 I personally don't like using the auto_prepend feature, but it's there
 and you could use it if you like, I'm a fan of implicitly requiring
 files if I need to.

 If your associative array, is really that large that it's going to slow
 things down, you may also want to consider whether all your scripts need
 all of the data, and then possibly define things that are only necessary
 for certain classes, in the file for that class.

 You can also serialize your associative array, and store it in the
 database.. but it's really all dependant on what you need, and what the
 app needs.



 david wrote:
 Hi

 I am looking at converting a large project from ASP to PHP, and have read
 that there is no equivalent of global.asa in PHP. It is probably easiest 
 if
 I describe the problem starting with how the ASP does it:

 Project uses global.asa to load a lot of 'global' constants and variables
 into memory. This includes translations for the web site in a number of
 different languages. These are loaded from text files so that changing 
 them
 is easy. These items when loaded in global.asa are as if they are in an
 associative array which is available to the whole application - it is not
 destroyed when the page is destroyed!

 Any ideas how I could handle this in PHP? The ASP method seems sensible, 
 as
 the data is much too big to load for every page, and too common to load 
 only
 when required. Holding it in memory and it having application wide scope
 like this is fast. Loading only parts required at execution from, say, a
 database would surely be too costly in db calls?

 Anyone have any ideas about what I could do?

 Many thanks, David

 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] LAMP Server setup help

2007-09-08 Thread Randy Patterson
Hey,

I have setup a test system on my home network in the past to develop  test 
PHP apps by installing an ISAPI PHP dll in IIS. It worked great but now I 
trying to setup a LAMP server on Debian/Lenny. I ran the following command;

aptitude install apache2 php5 libapache2-mod-php5

But got the following error message;

Setting up apache2-mpm-prefork (2.2.4-3) ...
Starting web server: apache2apache2: Syntax error on line 187 
of /etc/apache2/apache2.conf: Syntax error on line 3 
of /etc/apache2/httpd.conf: Cannot load /etc/apache2/modules/libphp5.so into 
server: /etc/apache2/modules/libphp5.so: cannot open shared object file: No 
such file or directory
 failed!
invoke-rc.d: initscript apache2, action start failed.

The error is pointing to this line in the httpd.conf;

LoadModule php5_module  modules/libphp5.so

But this directory or file don't exist in the /etc/apache2 directory.

Not sure how to fix this. I'm a newbie when it comes to the LAMP server apps. 
Any help would be appreciated.

Thanks, 
Randy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Creating a File in Memory

2007-09-08 Thread Per Jessen
John Schattel wrote:

 lacks a file name.  So when a program like Google Earth tries to
 process the file, it fails.  When I bring ndfdViaPipe.kmz into WinZip,
 the file has no name but can otherwise be extracted just fine.  Once
 extracted, Google Earth can process the file.  Does anyone know how I
 might add the file name information to the ndfdViaPipe.kmz? 

Add some headers before you send the file:

header(Content-Type: application/octet-stream);
header(Content-Disposition: attachment; filename=\blah.zip\);


/Per Jessen, Zürich

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: html2png

2007-09-08 Thread Al

Imagick PHP extension, easiest, or Imagemagick command line using exec().

Imagick to read a pdf and output it as a jpeg:

header('Content-type: image/jpeg');
$obj = new Imagick('x.pdf');
$obj-SetImageFormat('jpeg');
echo $obj;

Your want to use montage, resizing and write the result to a file, etc.






timothy johnson wrote:

I was wondering if anyone knew of some php code that I could use to create
thumbnails of webpages.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LAMP Server setup help

2007-09-08 Thread brian

Randy Patterson wrote:

Hey,

I have setup a test system on my home network in the past to develop  test 
PHP apps by installing an ISAPI PHP dll in IIS. It worked great but now I 
trying to setup a LAMP server on Debian/Lenny. I ran the following command;


aptitude install apache2 php5 libapache2-mod-php5

But got the following error message;

Setting up apache2-mpm-prefork (2.2.4-3) ...
Starting web server: apache2apache2: Syntax error on line 187 
of /etc/apache2/apache2.conf: Syntax error on line 3 
of /etc/apache2/httpd.conf: Cannot load /etc/apache2/modules/libphp5.so into 
server: /etc/apache2/modules/libphp5.so: cannot open shared object file: No 
such file or directory

 failed!
invoke-rc.d: initscript apache2, action start failed.

The error is pointing to this line in the httpd.conf;

LoadModule php5_module  modules/libphp5.so

But this directory or file don't exist in the /etc/apache2 directory.



Look at the top of httpd.conf for a line with ServerRoot. That should 
point to where your modules reside. If that's correct and points to the 
proper modules dir with a bunch *.so files then the problem is that the 
libphp5 module is MIA. If you comment out that line (LoadModule 
php5_module ...) does the server daemon start up ok?


You might try searching for libphp5.so on your machine.

I'm not familiar with installing httpd with aptitude. Is it possible 
that you need to incude httpd-devel (apache2-devel?) in your install 
arguments? You need that for apxs but i don't know if aptitude takes 
care of that.


You could try:
aptitude purge libapache2-mod-php5
aptitude install libapache2-mod-php5

or:

apt-get remove --purge apache2 php5 libapache2-mod-php5

brian

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LAMP Server setup help

2007-09-08 Thread Børge Holen
On Saturday 08 September 2007 10:07, Randy Patterson wrote:
 Hey,

 I have setup a test system on my home network in the past to develop  test
 PHP apps by installing an ISAPI PHP dll in IIS. It worked great but now I
 trying to setup a LAMP server on Debian/Lenny. I ran the following command;

 aptitude install apache2 php5 libapache2-mod-php5

 But got the following error message;

 Setting up apache2-mpm-prefork (2.2.4-3) ...
 Starting web server: apache2apache2: Syntax error on line 187
 of /etc/apache2/apache2.conf: Syntax error on line 3
 of /etc/apache2/httpd.conf: Cannot load /etc/apache2/modules/libphp5.so
 into server: /etc/apache2/modules/libphp5.so: cannot open shared object
 file: No such file or directory
  failed!
 invoke-rc.d: initscript apache2, action start failed.

 The error is pointing to this line in the httpd.conf;

 LoadModule php5_modulemodules/libphp5.so

 But this directory or file don't exist in the /etc/apache2 directory.

 Not sure how to fix this. I'm a newbie when it comes to the LAMP server
 apps. Any help would be appreciated.

Seems very much like some missinformation of some kind. 
Apache2 should not use any modules/  directory.

Apache2 uses symlinks to enable modules, check if symlink exists.
In the directory mods-enabled there should reside syms like this:
php5.conf - ../mods-available/php5.conf
php5.load - ../mods-available/php5.load

Any other php relations within both httpd and apache2 conf is to be removed.
It does not complain over missing php libs, it complains about syntax error.


 Thanks,
 Randy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Reg.Photo Upload Tool

2007-09-08 Thread Børge Holen
On Friday 07 September 2007 12:07, Ramesh.b wrote:
 Thanks Jay,

 I want a client side tool , something similar to Yahoo photos or flickr,
 where it will shrink the size of the image and upload.

You'd be better of makin' one yerself. Last time I got some questions about 
fileuploads and checked out yahoo for a friend, maby I don't remember 
correctly but didn't I actually see flash as a frontend.
Who would want such a thing. None've us with a ppc-arch anyhow


 Thanks
 Ramesh
 Jay Blanchard [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 [snip]
 Any opensource or PHP applicaiton is available for Photo upload tool?.
 [/snip]

 Easy to do yourself
 http://us2.php.net/manual/en/features.file-upload.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Image Conversion...

2007-09-08 Thread Tony Di Croce
I need to convert (resize, and store as blob's in a mysql db) images my
users can upload. I'm wondering what the best conversion tool is... I'm
considering ImageMagick... Is this the best?

Is their anything that is integrated with PHP itself?

  td


Re: [PHP] LAMP Server setup help

2007-09-08 Thread Randy Patterson
On Saturday 08 September 2007 12:20, Børge Holen wrote:
 On Saturday 08 September 2007 10:07, Randy Patterson wrote:
  Hey,
 
  I have setup a test system on my home network in the past to develop 
  test PHP apps by installing an ISAPI PHP dll in IIS. It worked great but
  now I trying to setup a LAMP server on Debian/Lenny. I ran the following
  command;
 
  aptitude install apache2 php5 libapache2-mod-php5
 
  But got the following error message;
 
  Setting up apache2-mpm-prefork (2.2.4-3) ...
  Starting web server: apache2apache2: Syntax error on line 187
  of /etc/apache2/apache2.conf: Syntax error on line 3
  of /etc/apache2/httpd.conf: Cannot load /etc/apache2/modules/libphp5.so
  into server: /etc/apache2/modules/libphp5.so: cannot open shared object
  file: No such file or directory
   failed!
  invoke-rc.d: initscript apache2, action start failed.
 
  The error is pointing to this line in the httpd.conf;
 
  LoadModule php5_module  modules/libphp5.so
 
  But this directory or file don't exist in the /etc/apache2 directory.
 
  Not sure how to fix this. I'm a newbie when it comes to the LAMP server
  apps. Any help would be appreciated.

 Seems very much like some missinformation of some kind.
 Apache2 should not use any modules/  directory.

 Apache2 uses symlinks to enable modules, check if symlink exists.
 In the directory mods-enabled there should reside syms like this:
 php5.conf - ../mods-available/php5.conf
 php5.load - ../mods-available/php5.load

 Any other php relations within both httpd and apache2 conf is to be
 removed. It does not complain over missing php libs, it complains about
 syntax error.

 I think you have put your finger on the problem, those links are not there. I 
read this article on the subject;

http://www.debian-administration.org/articles/207

Which referred to these programs; a2ensite, a2dissite, a2enmod and a2dismod.

Although I have apache2 installed, these programs are not present. Are they 
part of another package? Not sure that I would get the links correct if I did 
it manually.

Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LAMP Server setup help

2007-09-08 Thread Børge Holen
On Saturday 08 September 2007 12:54, Randy Patterson wrote:
 On Saturday 08 September 2007 12:20, Børge Holen wrote:
  On Saturday 08 September 2007 10:07, Randy Patterson wrote:
   Hey,
  
   I have setup a test system on my home network in the past to develop 
   test PHP apps by installing an ISAPI PHP dll in IIS. It worked great
   but now I trying to setup a LAMP server on Debian/Lenny. I ran the
   following command;
  
   aptitude install apache2 php5 libapache2-mod-php5
  
   But got the following error message;
  
   Setting up apache2-mpm-prefork (2.2.4-3) ...
   Starting web server: apache2apache2: Syntax error on line 187
   of /etc/apache2/apache2.conf: Syntax error on line 3
   of /etc/apache2/httpd.conf: Cannot load /etc/apache2/modules/libphp5.so
   into server: /etc/apache2/modules/libphp5.so: cannot open shared object
   file: No such file or directory
failed!
   invoke-rc.d: initscript apache2, action start failed.
  
   The error is pointing to this line in the httpd.conf;
  
   LoadModule php5_modulemodules/libphp5.so
  
   But this directory or file don't exist in the /etc/apache2 directory.
  
   Not sure how to fix this. I'm a newbie when it comes to the LAMP server
   apps. Any help would be appreciated.
 
  Seems very much like some missinformation of some kind.
  Apache2 should not use any modules/  directory.
 
  Apache2 uses symlinks to enable modules, check if symlink exists.
  In the directory mods-enabled there should reside syms like this:
  php5.conf - ../mods-available/php5.conf
  php5.load - ../mods-available/php5.load
 
  Any other php relations within both httpd and apache2 conf is to be
  removed. It does not complain over missing php libs, it complains about
  syntax error.

  I think you have put your finger on the problem, those links are not
 there. I read this article on the subject;

 http://www.debian-administration.org/articles/207

 Which referred to these programs; a2ensite, a2dissite, a2enmod and
 a2dismod.

 Although I have apache2 installed, these programs are not present. Are they
 part of another package? Not sure that I would get the links correct if I
 did it manually.

 Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LAMP Server setup help

2007-09-08 Thread Børge Holen
On Saturday 08 September 2007 12:54, Randy Patterson wrote:
 On Saturday 08 September 2007 12:20, Børge Holen wrote:
  On Saturday 08 September 2007 10:07, Randy Patterson wrote:
   Hey,
  
   I have setup a test system on my home network in the past to develop 
   test PHP apps by installing an ISAPI PHP dll in IIS. It worked great
   but now I trying to setup a LAMP server on Debian/Lenny. I ran the
   following command;
  
   aptitude install apache2 php5 libapache2-mod-php5
  
   But got the following error message;
  
   Setting up apache2-mpm-prefork (2.2.4-3) ...
   Starting web server: apache2apache2: Syntax error on line 187
   of /etc/apache2/apache2.conf: Syntax error on line 3
   of /etc/apache2/httpd.conf: Cannot load /etc/apache2/modules/libphp5.so
   into server: /etc/apache2/modules/libphp5.so: cannot open shared object
   file: No such file or directory
failed!
   invoke-rc.d: initscript apache2, action start failed.
  
   The error is pointing to this line in the httpd.conf;
  
   LoadModule php5_modulemodules/libphp5.so
  
   But this directory or file don't exist in the /etc/apache2 directory.
  
   Not sure how to fix this. I'm a newbie when it comes to the LAMP server
   apps. Any help would be appreciated.
 
  Seems very much like some missinformation of some kind.
  Apache2 should not use any modules/  directory.
 
  Apache2 uses symlinks to enable modules, check if symlink exists.
  In the directory mods-enabled there should reside syms like this:
  php5.conf - ../mods-available/php5.conf
  php5.load - ../mods-available/php5.load
 
  Any other php relations within both httpd and apache2 conf is to be
  removed. It does not complain over missing php libs, it complains about
  syntax error.

  I think you have put your finger on the problem, those links are not
 there. I read this article on the subject;

 http://www.debian-administration.org/articles/207

 Which referred to these programs; a2ensite, a2dissite, a2enmod and
 a2dismod.

 Although I have apache2 installed, these programs are not present. Are they
 part of another package? Not sure that I would get the links correct if I
 did it manually.

is the files php5.conf and load inside the mods-available package?
Come to think of it, it sounds like a mixup of apache2 and 
libapache-php-mod... nah whatever.

if the files are there, its easy. 
Enter the dir
ln -s php5.conf ../mods-enabled/
ln -s php5.conf ../mods-enabled/

if not, print back the results for:
dpkg -l|grep apache
dpkg -l|grep php


 Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image Conversion... OT!

2007-09-08 Thread Børge Holen
On Saturday 08 September 2007 12:48, Tony Di Croce wrote:
 I need to convert (resize, and store as blob's in a mysql db) 
oh oh oh... NO we can slap the horse again ;D

 images my 
 users can upload. I'm wondering what the best conversion tool is... I'm
 considering ImageMagick... Is this the best?

consider using something you know for starters, then expand?
as for the question itself, yes is it the best?
anyone?


 Is their anything that is integrated with PHP itself?

   td

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image Conversion...

2007-09-08 Thread cajb
On 9/8/07, Tony Di Croce [EMAIL PROTECTED] wrote:
 I need to convert (resize, and store as blob's in a mysql db) images

avoid that for no further problems.

 ImageMagick

you can use this tool for your needs.


-- 
Romanul s-a nascut poet. Trebuia sa se nasca neamt!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image Conversion... OT!

2007-09-08 Thread Vidyut Luther
Børge Holen wrote:
 On Saturday 08 September 2007 12:48, Tony Di Croce wrote:
   
 I need to convert (resize, and store as blob's in a mysql db) 
 
 oh oh oh... NO we can slap the horse again ;D

   
 images my 
 users can upload. I'm wondering what the best conversion tool is... I'm
 considering ImageMagick... Is this the best?
 

 consider using something you know for starters, then expand?
 as for the question itself, yes is it the best?
 anyone?

   

Best is subjective, does it work the best? IMO yes, it's the best tool,
but keep in mind, this makes your script less portable, not all hosts
will allow you to run the 'convert' binary, nor will all installations
have it readily available (Windows doesn't come with ImageMagick by
default). It works the best for the applications I've written so far,
but the PHP gd functions are just as powerful and probably more
portable.. so without knowing all your requirements, it's hard to give a
definitive answer :).




 Is their anything that is integrated with PHP itself?

   td
 

   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image Conversion... OT!

2007-09-08 Thread Børge Holen
On Saturday 08 September 2007 13:59, Vidyut Luther wrote:
 Børge Holen wrote:
  On Saturday 08 September 2007 12:48, Tony Di Croce wrote:
  I need to convert (resize, and store as blob's in a mysql db)
 
  oh oh oh... NO we can slap the horse again ;D
 
  images my
  users can upload. I'm wondering what the best conversion tool is... I'm
  considering ImageMagick... Is this the best?
 
  consider using something you know for starters, then expand?
  as for the question itself, yes is it the best?
  anyone?

 Best is subjective, does it work the best? IMO yes, it's the best tool,
 but keep in mind, this makes your script less portable, not all hosts
 will allow you to run the 'convert' binary, nor will all installations
 have it readily available (Windows doesn't come with ImageMagick by
 default). It works the best for the applications I've written so far,
 but the PHP gd functions are just as powerful and probably more
 portable.. so without knowing all your requirements, it's hard to give a
 definitive answer :).

as I run my own host... I solely asking for  the quality. 
pnmscale and cjpeg is the tools currently in use.


  Is their anything that is integrated with PHP itself?
 
td

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image Conversion... OT!

2007-09-08 Thread Vidyut Luther
I've been using ImageMagick pretty much since 1997, I'm probably biased
or ignorant of other tools that are probably available to people these
days :). But, ImageMagick still works wonderfully for me, so.. yes it's
the best :).

Børge Holen wrote:
 On Saturday 08 September 2007 13:59, Vidyut Luther wrote:
   
 Børge Holen wrote:
 
 On Saturday 08 September 2007 12:48, Tony Di Croce wrote:
   
 I need to convert (resize, and store as blob's in a mysql db)
 
 oh oh oh... NO we can slap the horse again ;D

   
 images my
 users can upload. I'm wondering what the best conversion tool is... I'm
 considering ImageMagick... Is this the best?
 
 consider using something you know for starters, then expand?
 as for the question itself, yes is it the best?
 anyone?
   
 Best is subjective, does it work the best? IMO yes, it's the best tool,
 but keep in mind, this makes your script less portable, not all hosts
 will allow you to run the 'convert' binary, nor will all installations
 have it readily available (Windows doesn't come with ImageMagick by
 default). It works the best for the applications I've written so far,
 but the PHP gd functions are just as powerful and probably more
 portable.. so without knowing all your requirements, it's hard to give a
 definitive answer :).
 

 as I run my own host... I solely asking for  the quality. 
 pnmscale and cjpeg is the tools currently in use.

   
 Is their anything that is integrated with PHP itself?

   td
 

   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Can't execute PHP script

2007-09-08 Thread Randy Patterson
Hey,

[Note:] This is a different problem from the one I posted earlier today. 

I can't get my LAMP server setup to run PHP script.

As returned by apache2ctl, I am running;

Apache/2.2.4 (Debian) PHP/5.2.3-1+b1

I point my browser to;

http://localhost/apache2-default/test.php

The file test.php contains this code;

htmlbody
h1PHP Test/h1
br /
?php print Hello World!; ?
/body/html

The browser outputs only;

PHP Test

But the script doesn't get executed. I posted this problem on debian-users, 
[because I installed apache2/php5 via debian packages], without any results. 
Thought I would try here before finding an apache list. Although I have 
programed in PHP off and on for a while I am a newbie to the setup side of 
things. Hopefully someone could point me in the right direction to trouble 
shoot this. 

Thanks,
Randy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Can't execute PHP script

2007-09-08 Thread Børge Holen
as previously stated...

give us the printout of:
dpkg -l|grep apache
dpkg -l|grep php



On Saturday 08 September 2007 14:55, Randy Patterson wrote:
 Hey,

 [Note:] This is a different problem from the one I posted earlier today.

 I can't get my LAMP server setup to run PHP script.

 As returned by apache2ctl, I am running;

 Apache/2.2.4 (Debian) PHP/5.2.3-1+b1

 I point my browser to;

 http://localhost/apache2-default/test.php

 The file test.php contains this code;

 htmlbody
 h1PHP Test/h1
 br /
 ?php print Hello World!; ?
 /body/html

 The browser outputs only;

 PHP Test

 But the script doesn't get executed. I posted this problem on debian-users,
 [because I installed apache2/php5 via debian packages], without any
 results. Thought I would try here before finding an apache list. Although I
 have programed in PHP off and on for a while I am a newbie to the setup
 side of things. Hopefully someone could point me in the right direction to
 trouble shoot this.

 Thanks,
 Randy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Can't execute PHP script

2007-09-08 Thread brian

Randy Patterson wrote:

Hey,

[Note:] This is a different problem from the one I posted earlier today. 


I can't get my LAMP server setup to run PHP script.

As returned by apache2ctl, I am running;

Apache/2.2.4 (Debian) PHP/5.2.3-1+b1

I point my browser to;

http://localhost/apache2-default/test.php

The file test.php contains this code;

htmlbody
h1PHP Test/h1
br /
?php print Hello World!; ?
/body/html

The browser outputs only;

PHP Test



Check in your httpd.conf that you have all of the following:

LoadModule php5_module  modules/libphp5.so
AddHandler php5-script  php
AddType text/html   php

Make sure they're in there and uncommented. And that you restart httpd.

brian

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Buxa Coding Guidelines

2007-09-08 Thread magoo

Hi NG!

Just wanted to see what you think of the strictness of Buxa, according to 
their PHP guidelines:

http://www.buxaprojects.com/en/php_coding_guidelines.htm

In their oppinion stuff like the short PHP init ? or inline echo ?= 
$var ? is forbidden.

Do you people code that strict?

--
Kind regards,
magoo 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: html2png

2007-09-08 Thread Kevin Waterson
This one time, at band camp, Al [EMAIL PROTECTED] wrote:
The Imagick php extension is at RC2 and like all beta ware,
should not be considered for a production environment.


 Imagick PHP extension, easiest, or Imagemagick command line using exec().
 
 Imagick to read a pdf and output it as a jpeg:
 
 header('Content-type: image/jpeg');
 $obj = new Imagick('x.pdf');
 $obj-SetImageFormat('jpeg');
 echo $obj;
 
 Your want to use montage, resizing and write the result to a file, etc.



-- 
Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image Conversion...

2007-09-08 Thread Kevin Waterson
This one time, at band camp, Tony Di Croce [EMAIL PROTECTED] wrote:

 I need to convert (resize, and store as blob's in a mysql db) images my
 users can upload. I'm wondering what the best conversion tool is... I'm
 considering ImageMagick... Is this the best?
 
 Is their anything that is integrated with PHP itself?
 
   td
 

http://phpro.org/tutorials/Storing-Images-in-MySQL-with-PHP.html


-- 
Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] pdo_mysql segfault error

2007-09-08 Thread Slith
i'm trying to enable pdo_mysql extension, however i keep getting the 
following segfault error when i restart apache:


httpd[20567]: segfault at 0020abef8f07 rip 0020abef8f07 rsp 
006e6ad0 error 14


my setup is the following:

Apache 1.3.37
php 5.2.2
mysql 5.0.41

not sure wether this problem is cause by my newer mysql version or 64bit 
server. has any gotten PDO_MYSQL on 64bit server?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Buxa Coding Guidelines

2007-09-08 Thread tedd

At 12:17 AM +0200 9/9/07, magoo wrote:

Hi NG!

Just wanted to see what you think of the strictness of Buxa, 
according to their PHP guidelines:

http://www.buxaprojects.com/en/php_coding_guidelines.htm

In their oppinion stuff like the short PHP init ? or inline echo 
?= $var ? is forbidden.

Do you people code that strict?


I do.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Buxa Coding Guidelines

2007-09-08 Thread Kevin Waterson
This one time, at band camp, tedd [EMAIL PROTECTED] wrote:

 At 12:17 AM +0200 9/9/07, magoo wrote:
 Hi NG!
 
 Just wanted to see what you think of the strictness of Buxa, 
 according to their PHP guidelines:
 http://www.buxaprojects.com/en/php_coding_guidelines.htm
 
 In their oppinion stuff like the short PHP init ? or inline echo 
 ?= $var ? is forbidden.
 Do you people code that strict?
 
 I do.

me too, that sort of code is an abomination.
Short tags are not portable and should never have been introduced and
should not remain in php6

enjoy
Kevin

-- 
Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Converting PHP code to C#?

2007-09-08 Thread Symbian



mike-22 wrote:
 
 just hard code the IV in both places.
 

Thanks for the link, that was most useful, especially the commented bits!

RE: The IV, reading the php manual it states that the IV is not used when
ECB mode is used (which is what we are using). So knowing this does the use
of IV matter? I stripped the decrypt routine from the PHP file (big file!)
and tried it on a seperate PHP page without parsing a IV like so:

mcrypt_decrypt(MCRYPT_RIJNDAEL_128,$key,$mcryptData,MCRYPT_MODE_ECB,); 

While i got an error from the module:

Warning:  mcrypt_decrypt() [function.mcrypt-decrypt]: The IV parameter must
be as long as the blocksize in crypto.php on line 38

It still decrypted it fine on the php page.
-- 
View this message in context: 
http://www.nabble.com/Converting-PHP-code-to-C---tf4397727.html#a12575594
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Pack function in C#

2007-09-08 Thread Symbian

hello,

Our PHP dev (who has since left) uses the pack function to turn a base64
string into a binary blob (?):

$blob = pack(H*, $postBase64Data);

Does anyone know what the above is doing? I need to translate that to C#
terms, which I thought was getting the eqivalent of the bytes:

byte[] blob = ASCIIEncoding.UTF8.GetBytes(postedData);

But this may not be right.

Sym
-- 
View this message in context: 
http://www.nabble.com/Pack-function-in-C--tf4407990.html#a12575709
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] zlib.inflate vs. gzopen/fread

2007-09-08 Thread Gregory Beaver
Hi all,

I've run into a peculiar situation where the inflate implementation in
the zlib.inflate filter fails to successfully inflate a gzipped file
created using gzopen/gzwrite.  The file is really quite simple.  To
replicate, download http://pear.php.net/get/PEAR-1.6.1.tgz and run this
script:

?php
$fp = fopen('PEAR-1.6.1.tgz', 'rb');
stream_filter_append($fp, 'zlib.inflate');
var_dump(fread($fp, 2000), feof($fp));
fclose($fp);
?

output is:

string(0) 
bool(false)

The results are the same when using file_get_contents(), readfile(), and
also with the zlib.inflate example in the PHP manual.  This is on a
64-bit system with PHP 5.2.4 CVS HEAD, although the zlib.inflate
implementation hasn't changed substantially since 2005 (and yes, I also
tested it without the 3-line patch introduced in PHP 5.2.1 to see if it
was the cause).

Can anyone else confirm the above behavior?

Thanks,
Greg

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Buxa Coding Guidelines

2007-09-08 Thread Greg Donald
On Sun, 9 Sep 2007, magoo wrote:
 Just wanted to see what you think of the strictness of Buxa, according to
 their PHP guidelines:
 http://www.buxaprojects.com/en/php_coding_guidelines.htm

 In their oppinion stuff like the short PHP init ? or inline echo ?= $var
 ? is forbidden.
 Do you people code that strict?

I don't put PHP in my HTML.  I use PHP to build my HTML, using heredoc
syntax while doing so.  My scripts usually only have a single ?php
opening tag and never require any closing ? tags.

Code that contains short open tags or instances of ?= is amatuer in my
opinion.


-- 
Greg Donald
Cyberfusion Consulting
http://cyberfusionconsulting.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Converting PHP code to C#?

2007-09-08 Thread mike
i'm pretty sure the IV mattered in our stuff.

and remember i used CBC i think not EBC, and it worked fine. not sure
if you want to try that and make it work for you or not without any
warnings :)

On 9/8/07, Symbian [EMAIL PROTECTED] wrote:



 mike-22 wrote:
 
  just hard code the IV in both places.
 

 Thanks for the link, that was most useful, especially the commented bits!

 RE: The IV, reading the php manual it states that the IV is not used when
 ECB mode is used (which is what we are using). So knowing this does the use
 of IV matter? I stripped the decrypt routine from the PHP file (big file!)
 and tried it on a seperate PHP page without parsing a IV like so:

 mcrypt_decrypt(MCRYPT_RIJNDAEL_128,$key,$mcryptData,MCRYPT_MODE_ECB,);

 While i got an error from the module:

 Warning:  mcrypt_decrypt() [function.mcrypt-decrypt]: The IV parameter must
 be as long as the blocksize in crypto.php on line 38

 It still decrypted it fine on the php page.
 --
 View this message in context: 
 http://www.nabble.com/Converting-PHP-code-to-C---tf4397727.html#a12575594
 Sent from the PHP - General mailing list archive at Nabble.com.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Buxa Coding Guidelines

2007-09-08 Thread mike
On 9/8/07, Greg Donald [EMAIL PROTECTED] wrote:

 I don't put PHP in my HTML.  I use PHP to build my HTML, using heredoc
 syntax while doing so.  My scripts usually only have a single ?php
 opening tag and never require any closing ? tags.

 Code that contains short open tags or instances of ?= is amatuer in my
 opinion.

agreed. i use echo so i can indent my code. inline php/html mix bugs me.

although handing off to a templating engine/presentation layer would
be even better of course.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Converting PHP code to C#?

2007-09-08 Thread Symbian



mike-22 wrote:
 
 i'm pretty sure the IV mattered in our stuff.
 
 and remember i used CBC i think not EBC, and it worked fine. not sure
 if you want to try that and make it work for you or not without any
 warnings :)
 

Ah! We're using EBC, also I realised that I needed to implement the
eqivalent of the pack function in PHP which we use, so I finally have the
correct (MD5'd both the PHP and C# bits) string going *into* the function. 

Now I have to wrestle with the Rijndael class again:(

Rijndael r = Rijndael.Create();
r.Mode = CipherMode.ECB;
r.Padding = PaddingMode.None;
r.Key = Encoding.ASCII.GetBytes(KEY);
ICryptoTransform de = r.CreateDecryptor();
byte[] output = CryptoTransform(input, de);

Sym
-- 
View this message in context: 
http://www.nabble.com/Converting-PHP-code-to-C---tf4397727.html#a12576182
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php