php-general Digest 8 Sep 2007 17:30:25 -0000 Issue 5007

Topics (messages 261832 through 261837):

Re: 'application' variables not available? Alternatives?
        261832 by: david

LAMP Server setup help
        261833 by: Randy Patterson
        261836 by: brian
        261837 by: Børge Holen

Re: Creating a File in Memory
        261834 by: Per Jessen

Re: html2png
        261835 by: Al

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]


----------------------------------------------------------------------
--- Begin Message ---
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
>>
>> 

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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.

>
> Thanks,
> Randy

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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('xxxxx.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.


--- End Message ---

Reply via email to