|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help
lists.php.net
Date: Wed Feb 06 2008 - 13:28:19 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 6 Feb 2008 19:28:19 -0000 Issue 5278
Topics (messages 268749 through 268804):
Re: Fileinfo
268749 by: Mad Unix
268751 by: Paul Scott
268752 by: Mad Unix
268754 by: Chris
268755 by: Mad Unix
268756 by: Paul Scott
268757 by: Mad Unix
268758 by: Mad Unix
PHP CLI Problem
268750 by: Robbert van Andel
268753 by: Chris
268770 by: Jochem Maas
268775 by: Robbert van Andel
268778 by: Robbert van Andel
268781 by: Nathan Nobbe
268784 by: Jim Lucas
268785 by: Daniel Brown
268789 by: Robbert van Andel
268790 by: Nathan Nobbe
268791 by: Robbert van Andel
268792 by: Nathan Nobbe
268794 by: Nathan Nobbe
268796 by: Daniel Brown
Re: How could i do this on CURL?
268759 by: Louie Miranda
268761 by: Louie Miranda
Re: Doctrine vs. Propel
268760 by: AmirBehzad Eslami
Re: Anyone else doing PHP on Symbian?
268762 by: Peter Ford
Re: QNX build
268763 by: Richard
Re: string vs number
268764 by: Ford, Mike
268769 by: Jochem Maas
date() and wrong timezone (or time)
268765 by: Martin Marques
268780 by: Nathan Nobbe
268793 by: Martin Marques
268795 by: Nathan Nobbe
268797 by: Martin Marques
268798 by: Andrew Ballard
PHP Source code protection
268766 by: Zoran Bogdanov
268767 by: Richard Heyes
268776 by: Bastien Koert
268783 by: C.R.Vegelin
268786 by: Floor Terra
268787 by: Daniel Brown
268800 by: Greg Donald
268801 by: Greg Donald
268802 by: Richard Lynch
Re: New search related question
268768 by: Aschwin Wesselius
268788 by: Daniel Brown
Recommended ORM for PHP
268771 by: js
268772 by: Zoltán Németh
268773 by: Edward Kay
268799 by: Greg Donald
Re: PEAR website and MSIE 6
268774 by: Michelle Konzack
268777 by: Nathan Nobbe
Re: phpt or phpunit and why?
268779 by: js
268782 by: Nathan Nobbe
268803 by: Nathan Nobbe
Progressive answers from a php query?
268804 by: Richard
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
I did what you recommended i get the same erorr
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
max_execution_time = 3600 ; Maximum execution time of each script, in
seconds
max_input_time = 60 ; Maximum amount of time each script may spend
parsing request data
memory_limit = 64M ; Maximum amount of memory a script may consume
[root
linux4 ~]# pecl install Fileinfo
downloading Fileinfo-1.0.4.tgz ...
Starting to download Fileinfo-1.0.4.tgz (5,835 bytes)
.....done: 5,835 bytes
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 92160 bytes) in /usr/share/pear/PEAR/Builder.php on line 173
On Feb 4, 2008 8:10 AM, Daniel Brown <parasane
gmail.com> wrote:
> On Feb 4, 2008 4:06 AM, Mad Unix <madunix
gmail.com> wrote:
> > I can not install FileInfo... any help
> [snip]
>
> Note this line:
> Fatal error: Allowed memory size of 8388608 bytes exhausted (tried
> to....
>
> Update the php.ini to use more than 8MB. (See `memory_limit`)
>
> While you're at it, you may want to update your
> `max_execution_time` and `max_input_time`, but those shouldn't be
> factors here. Just something else you may run across.
>
> Whatever you do, if it's a production box, be sure to set
> reasonable limits, or else you open yourself up for far worse problems
> than not being able to install a module.
>
> --
> </Dan>
>
> Daniel P. Brown
> Senior Unix Geek
> <? while(1) { $me = $mind--; sleep(86400); } ?>
>
--
madunix
attached mail follows:
On Tue, 2008-02-05 at 22:49 -0800, Mad Unix wrote:
> I did what you recommended i get the same erorr
>
Depending on your distro, you may have 2 php.ini files. On debian based
systems there certainly are. One for Apache to use and another for cli.
Check that this is not the case first, you may just be using the
incorrect file.
At the end of the day, you could also just download the package, extract
it, phpize it make && make install it also and leave the problems
behind!
--Paul
All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm
attached mail follows:
I have only one file
[root
linux4 wv-1.0.3]# find / -name "php.ini" -print
/etc/php.ini
On Feb 5, 2008 10:55 PM, Paul Scott <pscott
uwc.ac.za> wrote:
>
> On Tue, 2008-02-05 at 22:49 -0800, Mad Unix wrote:
> > I did what you recommended i get the same erorr
> >
>
> Depending on your distro, you may have 2 php.ini files. On debian based
> systems there certainly are. One for Apache to use and another for cli.
>
> Check that this is not the case first, you may just be using the
> incorrect file.
>
> At the end of the day, you could also just download the package, extract
> it, phpize it make && make install it also and leave the problems
> behind!
>
> --Paul
>
>
> All Email originating from UWC is covered by disclaimer
> http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm
>
>
--
madunix
attached mail follows:
Mad Unix wrote:
> I did what you recommended i get the same erorr
>
> ;;;;;;;;;;;;;;;;;;;
> ; Resource Limits ;
> ;;;;;;;;;;;;;;;;;;;
>
> max_execution_time = 3600 ; Maximum execution time of each script, in
> seconds
> max_input_time = 60 ; Maximum amount of time each script may spend
> parsing request data
> memory_limit = 64M ; Maximum amount of memory a script may consume
>
> [root
linux4 ~]# pecl install Fileinfo
> downloading Fileinfo-1.0.4.tgz ...
> Starting to download Fileinfo-1.0.4.tgz (5,835 bytes)
> .....done: 5,835 bytes
>
> Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
> allocate 92160 bytes) in /usr/share/pear/PEAR/Builder.php on line 173
Maybe pear is setting the memory limit - coz it hasn't changed from 8M.
Maybe the pear mailing list would be a better place to ask (ie they'd
have more experience with the process & why this takes so much memory).
Seems a little silly that a 5k file takes over 8Meg of memory to me.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
thanks it works now....
wget http://pecl.php.net/get/Fileinfo-1.0.3.tgz
tar -zxf Fileinfo-1.0.3.tgz
cd Fileinfo-1.0.3
phpize
./configure
make
make install
Libraries have been installed in:
/usr/local/src/Fileinfo-1.0.3/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).
[root
linux4 Fileinfo-1.0.3]# make install
Installing shared extensions: /usr/lib64/php/modules/
On Feb 5, 2008 11:02 PM, Mad Unix <madunix
gmail.com> wrote:
> I have only one file
>
> [root
linux4 wv-1.0.3]# find / -name "php.ini" -print
> /etc/php.ini
>
>
> On Feb 5, 2008 10:55 PM, Paul Scott <pscott
uwc.ac.za> wrote:
>
> >
> > On Tue, 2008-02-05 at 22:49 -0800, Mad Unix wrote:
> > > I did what you recommended i get the same erorr
> > >
> >
> > Depending on your distro, you may have 2 php.ini files. On debian based
> > systems there certainly are. One for Apache to use and another for cli.
> >
> > Check that this is not the case first, you may just be using the
> > incorrect file.
> >
> > At the end of the day, you could also just download the package, extract
> > it, phpize it make && make install it also and leave the problems
> > behind!
> >
> > --Paul
> >
> >
> > All Email originating from UWC is covered by disclaimer
> > http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm
> >
> >
>
>
> --
> madunix
--
madunix
attached mail follows:
On Tue, 2008-02-05 at 23:13 -0800, Mad Unix wrote:
> thanks it works now....
>
> Libraries have been installed in:
> /usr/local/src/Fileinfo-1.0.3/modules
>
Be sure to remember to add the extension to your php.ini now as well
with an extension= line and restart your server for the changes to take
effect.
--Paul
--
------------------------------------------------------------.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za |
:------------------------------------------------------------:
All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm
attached mail follows:
regarding my horde installation it says NOW
memory_limit disabled: No
If PHP's internal memory limit is turned on and if not set high enough Horde
will not be able to handle large data items (e.g. large mail attachments in
IMP). If possible, you should disable the PHP memory limit by recompiling
PHP without the "--enable-memory-limit" flag. If this is not possible, then
you should set the value of memory_limit in php.ini to a sufficiently high
value (Current value of memory_limit: 64M).
# Mcrypt Support: No
MIME Magic Support (fileinfo): Yes
Mcrypt is a general-purpose cryptography library which is broader and
significantly more efficient (FASTER!) than PHP's own cryptographic code and
will provider faster logins.
# memcached Support (memcache): No
The memcache PECL module is needed only if you are using the memcached
SessionHandler. See horde/docs/INSTALL for information on how to install
PECL/PHP extensions.
memory_limit disabled: No
If PHP's internal memory limit is turned on and if not set high enough Horde
will not be able to handle large data items (e.g. large mail attachments in
IMP). If possible, you should disable the PHP memory limit by recompiling
PHP without the "--enable-memory-limit" flag. If this is not possible, then
you should set the value of memory_limit in php.ini to a sufficiently high
value (Current value of memory_limit: 64M).
# Auth_SASL: No
Horde will work without the Auth_SASL class, but if you use Access Control
Lists in IMP you should be aware that without this class passwords will be
sent to the IMAP server in plain text when retrieving ACLs.
# Net_SMTP: No
Make sure you are using the Net_SMTP module if you want "smtp" to work as a
mailer option.
# Services_Weather: No
Services_Weather is used by the weather applet/block on the portal page.
# Cache: No
Cache is used by the Services_Weather module on the weather applet/block on
the portal page.
# XML_Serializer: No
XML_Serializer is used by the Services_Weather module on the weather
applet/block on the portal page.
attached mail follows:
[root
linux4 html]# cat /etc/php.ini | grep -i fileinfo
extension=fileinfo.so
[root
linux4 html]# cat /etc/php.ini | grep -i modules
; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/lib64/php/modules"
; Note: packaged extension modules are now loaded via the .ini files
[root
linux4 html]#
On Feb 5, 2008 11:16 PM, Paul Scott <pscott
uwc.ac.za> wrote:
>
> On Tue, 2008-02-05 at 23:13 -0800, Mad Unix wrote:
> > thanks it works now....
> >
> > Libraries have been installed in:
> > /usr/local/src/Fileinfo-1.0.3/modules
> >
>
> Be sure to remember to add the extension to your php.ini now as well
> with an extension= line and restart your server for the changes to take
> effect.
>
> --Paul
> --
> ------------------------------------------------------------.
> | Chisimba PHP5 Framework - http://avoir.uwc.ac.za |
> :------------------------------------------------------------:
>
>
> All Email originating from UWC is covered by disclaimer
> http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm
>
>
--
madunix
attached mail follows:
I am having trouble with a PHP CLI script I wrote to help manage my website.
The site is on a shared hosting server where the PHP installation is set up
as a CGI. The script creates some backups of my databases and sends them to
Amazon's S3 service.
First off, the script runs great from the command line when I type "php5
backup.php" but when I type ./backup.php I get an error: "bash:
./backup.php: No such file or directory". I thought maybe this is a problem
with the top declaration in the script "#!/usr/local/bin/php5". The problem
is that it appears the server has several php5s I can reference
/usr/local/apache/share/cgi-bin/php5
/usr/local/bin/php5
But it doesn't matter which one I put at the top of the script, I get the
same error.
Okay, so I can live with having to type "php5 backup.php". However, when I
try to make a cron job from the script, the script never runs. The crontab
entry looks like this
1 0 * * 2 php5
/kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/
backup.php > backup.log
I know the backup never runs because I redirect the output to a file and
have an email sent to me upon conclusion of the script. The log file
doesn't show anything nor do I ever receive an email. My web host will not
provide any support for scripting, so I'm hoping someone here can help.
Questions:
* How do I determine what to put at the top of the script so that I can just
call "backup.php"?
* What, if anything, do I need to do to make the script work from cron?
I've seen some comments on the web regarding PHP CLI when PHP is a CGI, but
none of them seem to apply to me.
Thank you in advance for your help.
Robbert
attached mail follows:
> First off, the script runs great from the command line when I type "php5
> backup.php" but when I type ./backup.php I get an error: "bash:
> ./backup.php: No such file or directory".
Maybe backup.php that you think it's running is the wrong one.
Add something like:
echo "I am file " . __FILE__ . "\n";
in your backup.php file and see if that's printed out when you run "php5
backup.php".
If it's not, then you're editing the wrong file.
> I thought maybe this is a problem
> with the top declaration in the script "#!/usr/local/bin/php5".
If you have that as the first line, then you should just need to chmod
+x the backup.php file.
> The problem
> is that it appears the server has several php5s I can reference
>
> /usr/local/apache/share/cgi-bin/php5
> /usr/local/bin/php5
Ask your host which is the right one (99% sure it'll be
/usr/local/bin/php5).
> Questions:
> * How do I determine what to put at the top of the script so that I can just
> call "backup.php"?
What difference does it make whether the full path is included in the
cron job or not? You need to use the full path somewhere (whether it's
in the cron job or in a shell script).
You could create a shell script:
#!/bin/bash
/usr/local/bin/php5 -f /path/to/backup.php
chmod +x the new script.
Call that instead in cron.
> * What, if anything, do I need to do to make the script work from cron?
Use the full path to php, use the full path to your backup.php file.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Robbert van Andel schreef:
> I am having trouble with a PHP CLI script I wrote to help manage my website.
> The site is on a shared hosting server where the PHP installation is set up
> as a CGI. The script creates some backups of my databases and sends them to
> Amazon's S3 service.
>
> First off, the script runs great from the command line when I type "php5
> backup.php" but when I type ./backup.php I get an error: "bash:
> ./backup.php: No such file or directory".
is the script marked as executable?
> I thought maybe this is a problem
> with the top declaration in the script "#!/usr/local/bin/php5". The problem
> is that it appears the server has several php5s I can reference
>
> /usr/local/apache/share/cgi-bin/php5
> /usr/local/bin/php5
to determine which php5 you are using type:
$> which php5
this gives you the full path, which you will need to use in the relevant
cron line (and/or the shebang line at the top of the script) - cron requires fullpaths.
>
> But it doesn't matter which one I put at the top of the script, I get the
> same error.
>
> Okay, so I can live with having to type "php5 backup.php". However, when I
> try to make a cron job from the script, the script never runs. The crontab
> entry looks like this
> 1 0 * * 2 php5
> /kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/
> backup.php > backup.log
>
> I know the backup never runs because I redirect the output to a file and
> have an email sent to me upon conclusion of the script. The log file
> doesn't show anything nor do I ever receive an email. My web host will not
> provide any support for scripting, so I'm hoping someone here can help.
>
> Questions:
> * How do I determine what to put at the top of the script so that I can just
> call "backup.php"?
> * What, if anything, do I need to do to make the script work from cron?
>
> I've seen some comments on the web regarding PHP CLI when PHP is a CGI, but
> none of them seem to apply to me.
>
> Thank you in advance for your help.
>
> Robbert
>
attached mail follows:
Thank you, that was very helpful. I created a perl script because the shell
script wouldn't run either. It too gave an error stating the file or
directory could not be found. The perl script runs a shell command from
within it to run backup.php. Manual tests show that that works, I put it in
a cron job and am confident that it will run.
Robbert
-----Original Message-----
From: Chris [mailto:dmagick
gmail.com]
Sent: Tuesday, February 05, 2008 11:06 PM
To: Robbert van Andel
Cc: php-general
lists.php.net
Subject: Re: [PHP] PHP CLI Problem
> First off, the script runs great from the command line when I type "php5
> backup.php" but when I type ./backup.php I get an error: "bash:
> ./backup.php: No such file or directory".
Maybe backup.php that you think it's running is the wrong one.
Add something like:
echo "I am file " . __FILE__ . "\n";
in your backup.php file and see if that's printed out when you run "php5
backup.php".
If it's not, then you're editing the wrong file.
> I thought maybe this is a problem
> with the top declaration in the script "#!/usr/local/bin/php5".
If you have that as the first line, then you should just need to chmod
+x the backup.php file.
> The problem
> is that it appears the server has several php5s I can reference
>
> /usr/local/apache/share/cgi-bin/php5
> /usr/local/bin/php5
Ask your host which is the right one (99% sure it'll be
/usr/local/bin/php5).
> Questions:
> * How do I determine what to put at the top of the script so that I can
just
> call "backup.php"?
What difference does it make whether the full path is included in the
cron job or not? You need to use the full path somewhere (whether it's
in the cron job or in a shell script).
You could create a shell script:
#!/bin/bash
/usr/local/bin/php5 -f /path/to/backup.php
chmod +x the new script.
Call that instead in cron.
> * What, if anything, do I need to do to make the script work from cron?
Use the full path to php, use the full path to your backup.php file.
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I guess I spoke too soon. Even though the script runs from anywhere (that I
have access too), when I put the perl script in a cronjob, the php script
just refuses to run. There's no output, just the output from the perl
script. And yes, I did set up the perl script to print the output of the
php script. Any ideas? Is there some special consideration I have to give
to the fact that my PHP installation is setup as a CGI? I've never had this
much trouble getting a PHP CLI script to run.
Robbert
-----Original Message-----
From: Robbert van Andel [mailto:robbert
vafam.com]
Sent: Wednesday, February 06, 2008 6:14 AM
To: php-general
lists.php.net
Subject: RE: [PHP] PHP CLI Problem
Thank you, that was very helpful. I created a perl script because the shell
script wouldn't run either. It too gave an error stating the file or
directory could not be found. The perl script runs a shell command from
within it to run backup.php. Manual tests show that that works, I put it in
a cron job and am confident that it will run.
Robbert
-----Original Message-----
From: Chris [mailto:dmagick
gmail.com]
Sent: Tuesday, February 05, 2008 11:06 PM
To: Robbert van Andel
Cc: php-general
lists.php.net
Subject: Re: [PHP] PHP CLI Problem
> First off, the script runs great from the command line when I type "php5
> backup.php" but when I type ./backup.php I get an error: "bash:
> ./backup.php: No such file or directory".
Maybe backup.php that you think it's running is the wrong one.
Add something like:
echo "I am file " . __FILE__ . "\n";
in your backup.php file and see if that's printed out when you run "php5
backup.php".
If it's not, then you're editing the wrong file.
> I thought maybe this is a problem
> with the top declaration in the script "#!/usr/local/bin/php5".
If you have that as the first line, then you should just need to chmod
+x the backup.php file.
> The problem
> is that it appears the server has several php5s I can reference
>
> /usr/local/apache/share/cgi-bin/php5
> /usr/local/bin/php5
Ask your host which is the right one (99% sure it'll be
/usr/local/bin/php5).
> Questions:
> * How do I determine what to put at the top of the script so that I can
just
> call "backup.php"?
What difference does it make whether the full path is included in the
cron job or not? You need to use the full path somewhere (whether it's
in the cron job or in a shell script).
You could create a shell script:
#!/bin/bash
/usr/local/bin/php5 -f /path/to/backup.php
chmod +x the new script.
Call that instead in cron.
> * What, if anything, do I need to do to make the script work from cron?
Use the full path to php, use the full path to your backup.php file.
--
Postgresql & php tutorials
http://www.designmagick.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
attached mail follows:
On Feb 6, 2008 9:36 AM, Robbert van Andel <robbert
vafam.com> wrote:
> I guess I spoke too soon. Even though the script runs from anywhere (that
> I
> have access too), when I put the perl script in a cronjob, the php script
> just refuses to run. There's no output, just the output from the perl
> script. And yes, I did set up the perl script to print the output of the
> php script. Any ideas? Is there some special consideration I have to
> give
> to the fact that my PHP installation is setup as a CGI? I've never had
> this
> much trouble getting a PHP CLI script to run.
there are 2 ways to run a php cli script. the first is to prefix the name
of the script
with php; eg
php backup.php
if you are specifying this in a cron job, you will have to supply the full
path to the php
interpreter, which you can find via
which php
(sorry jocheem, i know you already said that, but my system doesnt have
php5, only
php [even though its 5] so i thought id mention it again)
that is the way i prefer to do it but i wont elaborate as there is no point
now.
the second way is to make the script executable; this is a 2 step process.
the first step
is to prefix the contents of the file with
#!/path/to/php/binary
where the path is the same as earlier, found via the which command. the
second step is
to mark the script as executable, hopefully you are familiar enough to do
that yourself,
but just to test it as the user who created it, you can do simply,
chmod u+x backup.php
i suspect in your case the cron job doesnt know the path to the php binary,
ive encountered
this before; although its strange its still occurring within the perl
script; however i cant help you
with that ;)
o, btw; here is the relevant page in the manual
http://us2.php.net/manual/en/features.commandline.php
-nathan
attached mail follows:
Robbert van Andel wrote:
> I am having trouble with a PHP CLI script I wrote to help manage my website.
> The site is on a shared hosting server where the PHP installation is set up
> as a CGI. The script creates some backups of my databases and sends them to
> Amazon's S3 service.
>
> First off, the script runs great from the command line when I type "php5
> backup.php" but when I type ./backup.php I get an error: "bash:
> ./backup.php: No such file or directory". I thought maybe this is a problem
> with the top declaration in the script "#!/usr/local/bin/php5". The problem
> is that it appears the server has several php5s I can reference
>
> /usr/local/apache/share/cgi-bin/php5
> /usr/local/bin/php5
>
> But it doesn't matter which one I put at the top of the script, I get the
> same error.
>
> Okay, so I can live with having to type "php5 backup.php". However, when I
> try to make a cron job from the script, the script never runs. The crontab
> entry looks like this
> 1 0 * * 2 php5
> /kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/
> backup.php > backup.log
Are you trying to add this to your /etc/crontab file directly, or are you
issuing crontab -e from the command line?
If you are entering the above line into the crontab directly, then you are
missing a parameter. Between the day of the week and where you have php5, you
need to add the user that the script is suppose to run as.
Since you are able to run the script manually, it must be something to do with
how/where you are entering it into cron and/or the environment variables
available to the user that your crontag launches the script as. Maybe without a
complete login, the cron user doesn't have the /usr/local/bin/ in its PATH ?
Just a couple thoughts.
>
> I know the backup never runs because I redirect the output to a file and
> have an email sent to me upon conclusion of the script. The log file
> doesn't show anything nor do I ever receive an email. My web host will not
> provide any support for scripting, so I'm hoping someone here can help.
>
> Questions:
> * How do I determine what to put at the top of the script so that I can just
> call "backup.php"?
> * What, if anything, do I need to do to make the script work from cron?
>
> I've seen some comments on the web regarding PHP CLI when PHP is a CGI, but
> none of them seem to apply to me.
>
> Thank you in advance for your help.
>
> Robbert
>
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
attached mail follows:
On Feb 6, 2008 1:55 AM, Robbert van Andel <robbert
vafam.com> wrote:
[snip]
> First off, the script runs great from the command line when I type "php5
> backup.php" but when I type ./backup.php I get an error: "bash:
> ./backup.php: No such file or directory". I thought maybe this is a problem
> with the top declaration in the script "#!/usr/local/bin/php5". The problem
> is that it appears the server has several php5s I can reference
See my note on this paragraph later in the message. And more
importantly, see the addendum "SECURITY NOTICE" at the tail-end of
this email.
> /usr/local/apache/share/cgi-bin/php5
> /usr/local/bin/php5
>
> But it doesn't matter which one I put at the top of the script, I get the
> same error.
In this case, use /usr/local/bin/php5, which will almost
undoubtedly be compiled as a CLI object, while the
../apache/share/cgi-bin/php5 is most likely a CGI binary or (less
likely) Apache module. However, keep this part in mind, as with the
first paragraph, for later in the message.
> Okay, so I can live with having to type "php5 backup.php". However, when I
> try to make a cron job from the script, the script never runs. The crontab
> entry looks like this
> 1 0 * * 2 php5
> /kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/
> backup.php > backup.log
In your cronjob, replace the php5 entry with the following
(including the backticks):
`which php5`
If that still doesn't work, replace it simply with php, not php5:
`which php`
This allows BASh/Shell to execute the eval'd command typed within
the backticks.
> I know the backup never runs because I redirect the output to a file and
> have an email sent to me upon conclusion of the script. The log file
> doesn't show anything nor do I ever receive an email. My web host will not
> provide any support for scripting, so I'm hoping someone here can help.
Are you certain that the user under which the script is executed
via cron is yourself? On rare occasions (some BSD boxes, Cobalt RaQ
RHL variants, et cetera), cron will not always run as the local user.
It may run as 'cron', 'crond', 'daemon', 'nobody', 'unpriv', 'anon',
or as whomever the sysop has it configured.
> Questions:
> * How do I determine what to put at the top of the script so that I can just
> call "backup.php"?
Doing that is not such a great idea, and here's where the first
two paragraphs come into play: remove the interpreter designation line
(the first line, containing the #! characters). Make sure the script
is enclosed in <?php ?> tags. You can find scripts that written to
specifically run as crons that instead have the interpreter
designator, but it's just one more thing you'll have to manually
change when porting from one system to another, or if your host
updates their configuration.
PLUS: Keep in mind that, even when using an interpreter
designator, you *still* have to enclose your code in the <?php ?> tags
(or, if short_open_tags is on, which it probably is, just use <? ?>
tags). Why? Because PHP is set to parse *only* code between those
tags, and even if you run the CLI with the -r flag (which allows you
to run code without the <? ?> tags), it will only run /one line/ of
code per call. (See: `which php` --help -OR- `which php5` --help)
So if you absolutely want to run it as ./backup.php from the local
directory, or /kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/backup.php,
here are the steps to do so:
1.) chmod 755
/kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/backup.php
2.) Line 1 (backup.php): #!/usr/local/bin/php5 (or whatever 'which
php5' or 'which php' says - no backticks here)
3.) Enclose your code in <? ?> tags, not including the interpreter
designator (first line).
> * What, if anything, do I need to do to make the script work from cron?
See above answers.
====
SECURITY NOTICE
====
Here are some things to consider in this specific situation:
1.) NEVER disclose full server path information as you did in
your email. From that, I was easily able to discover the domain name,
based upon the fact that Oregon is a US state and "swimming" would
indicate the interests were most likely of a group or charitable
ORGanization. ;-P
2.) It's always a Bad Idea[tm] to place crons of that nature
in the web path. I was able to run the cron without the need of
logging into your admin panel, because there was no security to stop
me. And while all it will do is create a backup of your databases in
this particular case, the output from that file also gives me *highly
sensitive*, critical information about the location of web path
information, and ABSOLUTE WORST - gives me full access to all of your
database information in plain-text, and even a convenient zip file.
ACTION ITEMS:
1.) *IMMEDIATELY* move the 'backups' directory out of the
webroot. Place it somewhere like
/kunden/homepages/23/d117947228/db-backups/ or even
/kunden/homepages/23/d117947228/crons/. Make sure to update any
scripts that rely on the webroot-located backups directory.
Otherwise, you WILL have data stolen. This list is archived on the
web all over, and it will only be a matter of time before some script
kiddie decides you're an easy target.
Hope that helps.
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
D'oh. I wondered why I got that email while I was driving. Thanks for the
security tip. I had actually planned on protecting those scripts after I
was done getting them to work.
I removed the shebang, verified the script still works from the command line
but it still doesn't work with Cron. I tried adding `which php5` and that
didn't work. If I run it as php, then I'm stuck using php4, so that's not
really an option.
Cron works on the server because I have several perl scripts running through
cron with no problems. In fact, I would probably give up on this given the
problems I'm having and write in perl, but the perl modules for Amazon's S3
service are poorly documented and I was not able to figure them out.
There are no cron logs and the output is not sent to me after a job has
completed.
-----Original Message-----
From: Daniel Brown [mailto:parasane
gmail.com]
Sent: Wednesday, February 06, 2008 7:52 AM
To: Robbert van Andel
Cc: php-general
lists.php.net
Subject: Re: [PHP] PHP CLI Problem
On Feb 6, 2008 1:55 AM, Robbert van Andel <robbert
vafam.com> wrote:
[snip]
> First off, the script runs great from the command line when I type "php5
> backup.php" but when I type ./backup.php I get an error: "bash:
> ./backup.php: No such file or directory". I thought maybe this is a
problem
> with the top declaration in the script "#!/usr/local/bin/php5". The
problem
> is that it appears the server has several php5s I can reference
See my note on this paragraph later in the message. And more
importantly, see the addendum "SECURITY NOTICE" at the tail-end of
this email.
> /usr/local/apache/share/cgi-bin/php5
> /usr/local/bin/php5
>
> But it doesn't matter which one I put at the top of the script, I get the
> same error.
In this case, use /usr/local/bin/php5, which will almost
undoubtedly be compiled as a CLI object, while the
../apache/share/cgi-bin/php5 is most likely a CGI binary or (less
likely) Apache module. However, keep this part in mind, as with the
first paragraph, for later in the message.
> Okay, so I can live with having to type "php5 backup.php". However, when
I
> try to make a cron job from the script, the script never runs. The
crontab
> entry looks like this
> 1 0 * * 2 php5
>
/kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/
> backup.php > backup.log
In your cronjob, replace the php5 entry with the following
(including the backticks):
`which php5`
If that still doesn't work, replace it simply with php, not php5:
`which php`
This allows BASh/Shell to execute the eval'd command typed within
the backticks.
> I know the backup never runs because I redirect the output to a file and
> have an email sent to me upon conclusion of the script. The log file
> doesn't show anything nor do I ever receive an email. My web host will
not
> provide any support for scripting, so I'm hoping someone here can help.
Are you certain that the user under which the script is executed
via cron is yourself? On rare occasions (some BSD boxes, Cobalt RaQ
RHL variants, et cetera), cron will not always run as the local user.
It may run as 'cron', 'crond', 'daemon', 'nobody', 'unpriv', 'anon',
or as whomever the sysop has it configured.
> Questions:
> * How do I determine what to put at the top of the script so that I can
just
> call "backup.php"?
Doing that is not such a great idea, and here's where the first
two paragraphs come into play: remove the interpreter designation line
(the first line, containing the #! characters). Make sure the script
is enclosed in <?php ?> tags. You can find scripts that written to
specifically run as crons that instead have the interpreter
designator, but it's just one more thing you'll have to manually
change when porting from one system to another, or if your host
updates their configuration.
PLUS: Keep in mind that, even when using an interpreter
designator, you *still* have to enclose your code in the <?php ?> tags
(or, if short_open_tags is on, which it probably is, just use <? ?>
tags). Why? Because PHP is set to parse *only* code between those
tags, and even if you run the CLI with the -r flag (which allows you
to run code without the <? ?> tags), it will only run /one line/ of
code per call. (See: `which php` --help -OR- `which php5` --help)
So if you absolutely want to run it as ./backup.php from the local
directory, or
/kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/
backup.php,
here are the steps to do so:
1.) chmod 755
/kunden/homepages/23/d117947228/htdocs/oregonswimming/administration/backup/
backup.php
2.) Line 1 (backup.php): #!/usr/local/bin/php5 (or whatever 'which
php5' or 'which php' says - no backticks here)
3.) Enclose your code in <? ?> tags, not including the interpreter
designator (first line).
> * What, if anything, do I need to do to make the script work from cron?
See above answers.
====
SECURITY NOTICE
====
Here are some things to consider in this specific situation:
1.) NEVER disclose full server path information as you did in
your email. From that, I was easily able to discover the domain name,
based upon the fact that Oregon is a US state and "swimming" would
indicate the interests were most likely of a group or charitable
ORGanization. ;-P
2.) It's always a Bad Idea[tm] to place crons of that nature
in the web path. I was able to run the cron without the need of
logging into your admin panel, because there was no security to stop
me. And while all it will do is create a backup of your databases in
this particular case, the output from that file also gives me *highly
sensitive*, critical information about the location of web path
information, and ABSOLUTE WORST - gives me full access to all of your
database information in plain-text, and even a convenient zip file.
ACTION ITEMS:
1.) *IMMEDIATELY* move the 'backups' directory out of the
webroot. Place it somewhere like
/kunden/homepages/23/d117947228/db-backups/ or even
/kunden/homepages/23/d117947228/crons/. Make sure to update any
scripts that rely on the webroot-located backups directory.
Otherwise, you WILL have data stolen. This list is archived on the
web all over, and it will only be a matter of time before some script
kiddie decides you're an easy target.
Hope that helps.
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On Feb 6, 2008 11:33 AM, Robbert van Andel <robbert
vafam.com> wrote:
> I tried adding `which php5` and that didn't work.
did you try running
which php5
on the cli to ensure it even maps to a path ? you might need
which php
instead.
-nathan
attached mail follows:
Not an option. Which php gives me php4 and the script requires php5.
From: Nathan Nobbe [mailto:quickshiftin
gmail.com]
Sent: Wednesday, February 06, 2008 8:39 AM
To: Robbert van Andel
Cc: Daniel Brown; php-general
lists.php.net
Subject: Re: [PHP] PHP CLI Problem
On Feb 6, 2008 11:33 AM, Robbert van Andel <robbert
vafam.com> wrote:
I tried adding `which php5` and that didn't work.
did you try running
which php5
on the cli to ensure it even maps to a path ? you might need
which php
instead.
-nathan
attached mail follows:
On Feb 6, 2008 11:42 AM, Robbert van Andel <robbert
vafam.com> wrote:
> Not an option. Which php gives me php4 and the script requires php5.
>
it sounds like you are using 1&1, per dans security warning earlier :)
you may want to contact them and ask them how to run php5 scripts
via the cli; as i know they allow usage of both 4 and 5 from the webserver,
which is configurable via .htaccess directives.
and, btw, if you do find out, let us know; i for one am curious how they are
doing this (if at all..).
-nathan
attached mail follows:
On Feb 6, 2008 11:48 AM, Robbert van Andel <robbert
vafam.com> wrote:
> I contacted 1&1 and was told scripting was not supported. I wrote back
> saying I didn't need help writing the script just how to run it. They wrote
> back telling me to put it in a cron job using crontab –e and that was all
> **rolls eyes**. Perhaps a call will give me the answers I need.
>
rob, please keep list topics on list for the benefit of others.
if you dont get the answer you looking for; allow me to propose
a dirty workaround.
put the script in the webroot; then you can invoke it from cron
using curl; i imagine they have that installed. you can protect
the script with the following as the first line
if($_SERVER['REMOTE_ADDR'] !== '127.0.0.1') { die; }
then you could hit if from cron as in
`which curl` http://localhost/backup.php
im now waiting for what will surely be moments for another member
of the list to hack this idea to pieces ;)
but it was fun to think up!
-nathan
attached mail follows:
On Feb 6, 2008 12:25 PM, Nathan Nobbe <quickshiftin
gmail.com> wrote:
> put the script in the webroot; then you can invoke it from cron
> using curl; i imagine they have that installed. you can protect
> the script with the following as the first line
> if($_SERVER['REMOTE_ADDR'] !== '127.0.0.1') { die; }
>
> then you could hit if from cron as in
> `which curl` http://localhost/backup.php
>
> im now waiting for what will surely be moments for another member
> of the list to hack this idea to pieces ;)
> but it was fun to think up!
No, it's a valid idea, Nate. However, additional suggestions when
going this route:
1.) Stop all public output from the script, regardless of whether
or not it's only allowed by localhost.
2.) Still, move the databases and backups out of the web root.
3.) Instead of using `which curl` in the cron, use the *nix-only
GET command (case sensitive).
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
It ain't easy. I have also read the FAQ of cURL
http://curl.haxx.se/docs/faq.html#Can_I_use_curl_to_send_a_POST_PU
3.18 Can I use curl to send a POST/PUT and not wait for a response?
> No.
> But you could easily write your own program using libcurl to do such
> stunts.
>
Although, i was able to write my own PHP App. I did use PEAR Net_Curl BTW.
<?php
.....
$incomingAId = $_POST['a_id'];
$incomingATrackingId = $_POST['a_tracking_id'];
LogResults("On Access");
// Validate if empty, execute if not
if (!empty($incomingAId) || !empty($incomingATrackingId))
{
SendResponse();
}
else
{
Initiate();
}
function Initiate()
{
// Initiate
$curl = & new Net_Curl("https://test.example.com/Servlet");
$result = $curl->create();
if (!PEAR::isError($result)) {
// Set other options here with Net_Curl::setOption()
$params = "a_id=1234&app_name=cart&a_tracking_id=111";
$curl->setOption(CURLOPT_COOKIEJAR, "cookieFile.txt");
$curl->setOption(CURLOPT_POST, 1);
$curl->setOption(CURLOPT_POSTFIELDS, $params);
$result = $curl->execute();
if (!PEAR::isError($result)) {
//echo $result."\n";
} else {
//echo $result->getMessage()."\n";
}
$curl->close();
} else {
//echo $result->getMessage()."\n";
}
}
function SendResponse()
{
LogResults("SendResponse");
// Initiate
$curl = & new Net_Curl("https://test.example.com/Servlet");
$result = $curl->create();
if (!PEAR::isError($result)) {
$xmlSubmission = '<?xml version="1.0"?>';
$xmlSubmission .= '<collection_request>';
$xmlSubmission .= '<response_message value="Request" />';
$xmlSubmission .= '</collection_request>';
$postedTraffic = "&XML=".$xmlSubmission."";
$curl->setOption(CURLOPT_RETURNTRANSFER, 1);
$curl->setOption(CURLOPT_COOKIEFILE, "cookieFile.txt");
$curl->setOption(CURLOPT_POSTFIELDS, $postedTraffic);
$result = $curl->execute();
if (!PEAR::isError($result)) {
//echo $result."\n";
} else {
//echo $result->getMessage()."\n";
}
$curl->close();
} else {
//echo $result->getMessage()."\n";
}
}
......
?>
On Feb 6, 2008 9:17 AM, Manuel Lemos <mlemos
acm.org> wrote:
> Hello,
>
> on 02/05/2008 10:34 PM Louie Miranda said the following:
> > I was able to create a working CURL connection and it was great.
> >
> > Although, i have another problem.
> >
> >
> > 1. file: connect - I connect via a CURL to a URL and sends two
> > parameters (application, just wait and hangs) -- this is intentional
> > 2. file: connect - Receives a reply of the two parameters that i had
> > just sent
> > 3. file: connect - sends a XML post to the remote url (remote url,
> > closes the connection and application)
> >
> > Could i send two CURL request in one instance? while waiting?
>
> I am not sure how to do that in a simple way with Curl. The few times I
> have used Curl directly, I used custom HTTP requests instead of other
> options.
>
> Nowadays I use this HTTP client class that wraps the complexity of the
> HTTP protocol and uses preferrably fsockopen to send HTTP requests. Take
> a look the test_http_soap.php example which seems to do something
> similar to what you want:
>
> http://www.phpclasses.org/httpclient
>
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP professionals looking for PHP jobs
> http://www.phpclasses.org/professionals/
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
--
Louie Miranda (lmiranda
gmail.com)
http://www.axishift.com
Security Is A Series Of Well-Defined Steps
chmod -R 0 / ; and smile :)
attached mail follows:
BTW,
I just have read your script. I'll try it tomorrow. Looks like it will work
for me.
Louie
On Feb 6, 2008 3:33 PM, Louie Miranda <lmiranda
gmail.com> wrote:
> It ain't easy. I have also read the FAQ of cURL
> http://curl.haxx.se/docs/faq.html#Can_I_use_curl_to_send_a_POST_PU
>
> 3.18 Can I use curl to send a POST/PUT and not wait for a response?
> > No.
> > But you could easily write your own program using libcurl to do such
> > stunts.
> >
>
> Although, i was able to write my own PHP App. I did use PEAR Net_Curl BTW.
>
> <?php
> .....
>
> $incomingAId = $_POST['a_id'];
> $incomingATrackingId = $_POST['a_tracking_id'];
>
> LogResults("On Access");
>
> // Validate if empty, execute if not
> if (!empty($incomingAId) || !empty($incomingATrackingId))
> {
> SendResponse();
> }
> else
> {
> Initiate();
> }
>
>
> function Initiate()
> {
> // Initiate
> $curl = & new Net_Curl("https://test.example.com/Servlet");
> $result = $curl->create();
>
> if (!PEAR::isError($result)) {
>
> // Set other options here with Net_Curl::setOption()
> $params = "a_id=1234&app_name=cart&a_tracking_id=111";
>
> $curl->setOption(CURLOPT_COOKIEJAR, "cookieFile.txt");
> $curl->setOption(CURLOPT_POST, 1);
> $curl->setOption(CURLOPT_POSTFIELDS, $params);
>
> $result = $curl->execute();
> if (!PEAR::isError($result)) {
> //echo $result."\n";
> } else {
> //echo $result->getMessage()."\n";
> }
>
> $curl->close();
> } else {
> //echo $result->getMessage()."\n";
> }
> }
>
> function SendResponse()
> {
> LogResults("SendResponse");
>
> // Initiate
> $curl = & new Net_Curl("https://test.example.com/Servlet");
> $result = $curl->create();
>
> if (!PEAR::isError($result)) {
>
> $xmlSubmission = '<?xml version="1.0"?>';
> $xmlSubmission .= '<collection_request>';
> $xmlSubmission .= '<response_message value="Request" />';
> $xmlSubmission .= '</collection_request>';
>
> $postedTraffic = "&XML=".$xmlSubmission."";
>
> $curl->setOption(CURLOPT_RETURNTRANSFER, 1);
> $curl->setOption(CURLOPT_COOKIEFILE, "cookieFile.txt");
> $curl->setOption(CURLOPT_POSTFIELDS, $postedTraffic);
>
> $result = $curl->execute();
> if (!PEAR::isError($result)) {
> //echo $result."\n";
> } else {
> //echo $result->getMessage()."\n";
> }
>
> $curl->close();
> } else {
> //echo $result->getMessage()."\n";
> }
> }
>
> ......
> ?>
>
>
> On Feb 6, 2008 9:17 AM, Manuel Lemos <mlemos
acm.org> wrote:
>
> > Hello,
> >
> > on 02/05/2008 10:34 PM Louie Miranda said the following:
> > > I was able to create a working CURL connection and it was great.
> > >
> > > Although, i have another problem.
> > >
> > >
> > > 1. file: connect - I connect via a CURL to a URL and sends two
> > > parameters (application, just wait and hangs) -- this is
> > intentional
> > > 2. file: connect - Receives a reply of the two parameters that i
> > had
> > > just sent
> > > 3. file: connect - sends a XML post to the remote url (remote url,
> > > closes the connection and application)
> > >
> > > Could i send two CURL request in one instance? while waiting?
> >
> > I am not sure how to do that in a simple way with Curl. The few times I
> > have used Curl directly, I used custom HTTP requests instead of other
> > options.
> >
> > Nowadays I use this HTTP client class that wraps the complexity of the
> > HTTP protocol and uses preferrably fsockopen to send HTTP requests. Take
> > a look the test_http_soap.php example which seems to do something
> > similar to what you want:
> >
> > http://www.phpclasses.org/httpclient
> >
> >
> > --
> >
> > Regards,
> > Manuel Lemos
> >
> > PHP professionals looking for PHP jobs
> > http://www.phpclasses.org/professionals/
> >
> > PHP Classes - Free ready to use OOP components written in PHP
> > http://www.phpclasses.org/
> >
>
>
>
> --
> Louie Miranda (lmiranda
gmail.com)
> http://www.axishift.com
>
> Security Is A Series Of Well-Defined Steps
> chmod -R 0 / ; and smile :)
>
--
Louie Miranda (lmiranda
gmail.com)
http://www.axishift.com
Security Is A Series Of Well-Defined Steps
chmod -R 0 / ; and smile :)
attached mail follows:
Thank you all for your kind replies.
attached mail follows:
Paul Scott wrote:
> On Tue, 2008-02-05 at 13:29 -0500, Daniel Brown wrote:
>> Still debating what
>> device I'll get next, but I want to use it as a mobile server myself.
>> I had been working on a bound-for-trash PDA doing the same a while
>> back, but with what we'll refer to as "limited results."
>
> I think that the key here is
>
> 1. A decent ARM processor and a PHP build for ARM specifically (new
> project??)
>
> 2. Enough RAM to be useful - at least figure out how to use a SD card or
> something as a RAMDisk and use like a 2GB card?
>
> 3. Getting an entire LAMP stack on there as a package - no use messing
> with things - otherwise people won't use it.
>
> Just think of the possibilities though... I do a lot in the eLearning
> sphere in PHP, and this type of thing could be a mobile eLearning server
> for rural schools in Africa that is actually affordable! Students could
> connect to it via thin clients or mobile phones and get an education all
> in one.
>
To be honest Paul, I think you'd find that an EeePC would be cheaper than a
sufficiently well-specced PDA, especially given the time and effort required for
the key points you describe. An EeePC already runs Linux, with a decent
processor, reasonable "disk" space and good connectivity options, so a LAMP
stack ought to be easy.
attached mail follows:
Jochem Maas used his keyboard to write :
> Richard schreef:
>> Jochem Maas was thinking very hard :
>>> Richard schreef:
>>>> Jochem Maas wrote :
>>>>> Richard schreef:
>>>>>> Hi,
>>>>>>
>>>>>> After installing PHP on a Windows machine I see a very small
>>>>>> PHP-executable and several extension dll's that can be loaded.
>>>>>>
>>>>>> When I build PHP on a QNX machine I get one huge executable of 8.6 MB.
>>>>>> Is it possible to build something similar to the Windows version?
>>>>>
>>>>> yes, by specifying to ./configure that it should build shared extensions
>>>>> or those extensions that allow it. so the relevant ./configure options
>>>>> will look something like:
>>>>>
>>>>> --enable-foo=shared,/path/to/libs
>>>> I tried that but it didn't work.
>>>
>>> didn't work in what way?
>>
>> It is still one binary of 8.6 MB and no shared libs.
>>
>>>
>>>>>
>>>>> what's your configure line look like right now?
>>>>>
>>>>> PS - I'd never heard of QNX - just looked it up - interested to know
>>>>> what your
>>>>> doing with it and php.
>>>> I have an embedded system with an sqlite database. I want a web interface
>>>> that shows database info and maybe system info.
>>>
>>> cool :-)
>>>
>>>>>
>>>>> PPS - Is a single large binary any worse than a smaller binary that
>>>>> loads
>>>>> in a bunch of extensions (assuming the same extensions in each case),
>>>>> won't
>>>>> the memory footprint be near enough the same for each?
>>>> It seems that my system has a problem with loading large binaries. It
>>>> would be nice if I could decide in the ini file which extensions will be
>>>> loaded (I am not sure which extensions I need).
>>>> I use the shttpd web server. This one does not support fast cgi. Loading
>>>> a large cgi interpreter each time slows down my system.
>>>
>>> ok - seems like you will only be needing a small subset of the available
>>> extensions.
>>> have you tried using --disable-all and then only enabling the extensions
>>> you really
>>> need, It may get the binary size down to a usable level.
>>>
>>
>> When I use the option --disable-all the binary is about 5 MB. Which is much
>> too large.
>> An option could be not to use php but perl. This binary is 1 MB. But I
>> think the best option is a web server with fast cgi.
Removing the debugging symbols and enabling the extensions I need gives
me a binary of 2.7 MB which is already better.
>
> lighthttpd?
It took me a while to port lighttpd + libs but it is just what I am
looking for.
Thanks a lot.
>
>>
>>>>>
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Richard
>>>>>>
>>>>
>>
attached mail follows:
On 05 February 2008 21:37, Jochem Maas advised:
> the same is not exactly true for floats - although you can
> use them as array keys you'll
> notice in the output of code below that they are stripped of
> their decimal part (essentially
> a floor() seems to be performed on the float value. I have no
> idea whether this is intentional,
> and whether you can therefore rely on this behaviour:
Yes, and Yes!
From http://php.net/language.types.array:
> A key may be either an integer or a string. If a key is the
> standard representation of an integer, it will be interpreted
> as such (i.e. "8" will be interpreted as 8, while "08" will
> be interpreted as "08"). Floats in key are truncated to
> integer.
--
Mike Ford, Electronic Information Services Adviser,
JG125, The Headingley Library,
James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 812 4730 Fax: +44 113 812 3211
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
attached mail follows:
Ford, Mike schreef:
> On 05 February 2008 21:37, Jochem Maas advised:
>
>> the same is not exactly true for floats - although you can
>> use them as array keys you'll
>> notice in the output of code below that they are stripped of
>> their decimal part (essentially
>> a floor() seems to be performed on the float value. I have no
>> idea whether this is intentional,
>> and whether you can therefore rely on this behaviour:
>
> Yes, and Yes!
>
> From http://php.net/language.types.array
ah yes, I should have looked it up, that said I find it rather odd that
is works let alone that it's intentional.
though thinking about it you could probably use it for some float val
distribution counting or something. I dunno, seems like it offers a handy
shortcut - although what that shortcut is escapes me just now :-)
>
>> A key may be either an integer or a string. If a key is the
>> standard representation of an integer, it will be interpreted
>> as such (i.e. "8" will be interpreted as 8, while "08" will
>> be interpreted as "08"). Floats in key are truncated to
>> integer.
>
> --
> Mike Ford, Electronic Information Services Adviser,
> JG125, The Headingley Library,
> James Graham Building, Leeds Metropolitan University,
> Headingley Campus, LEEDS, LS6 3QS, United Kingdom
> Email: m.ford
leedsmet.ac.uk
> Tel: +44 113 812 4730 Fax: +44 113 812 3211
>
>
> To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
>
attached mail follows:
I got an update from tzdata on a Debian server due to a daylight saving
change here in Argentina.
The problem is that, even when the system sees the correct time, php
keeps giving me the *old* hour.
$ date
mié feb 6 09:03:57 ARST 2008
$ echo "<?php echo date('H:i') . \"\n\"; ?>"|php5
08:04
What can my problem be?
BTW, I did a useless reboot (I knew it wouldn't help at all, but I did
it anyway).
attached mail follows:
On Feb 6, 2008 6:13 AM, Martin Marques <martin
marquesminen.com.ar> wrote:
> I got an update from tzdata on a Debian server due to a daylight saving
> change here in Argentina.
>
> The problem is that, even when the system sees the correct time, php
> keeps giving me the *old* hour.
>
> $ date
> mié feb 6 09:03:57 ARST 2008
> $ echo "<?php echo date('H:i') . \"\n\"; ?>"|php5
> 08:04
>
> What can my problem be?
see what you have as the value for the date.timezone ini setting.
-nathan*
*
attached mail follows:
Nathan Nobbe escribió:
> On Feb 6, 2008 6:13 AM, Martin Marques <martin
marquesminen.com.ar> wrote:
>
>> I got an update from tzdata on a Debian server due to a daylight saving
>> change here in Argentina.
>>
>> The problem is that, even when the system sees the correct time, php
>> keeps giving me the *old* hour.
>>
>> $ date
>> mié feb 6 09:03:57 ARST 2008
>> $ echo "<?php echo date('H:i') . \"\n\"; ?>"|php5
>> 08:04
>>
>> What can my problem be?
>
>
> see what you have as the value for the date.timezone ini setting.
I've already checked that, and it's not set.
Anyway, I found out that PHP uses an internal tz database (very bad
IMHO) and it might be out of date.
attached mail follows:
On Feb 6, 2008 12:13 PM, Martin Marques <martin
marquesminen.com.ar> wrote:
> > see what you have as the value for the date.timezone ini setting.
>
> I've already checked that, and it's not set.
then you should probly set it ;)
Anyway, I found out that PHP uses an internal tz database (very bad
> IMHO) and it might be out of date.
>
what is a better alternative in your opinion; i dont know much about any
alternatives..
-nathan
attached mail follows:
Nathan Nobbe escribió:
> On Feb 6, 2008 12:13 PM, Martin Marques <martin
marquesminen.com.ar> wrote:
>
>>> see what you have as the value for the date.timezone ini setting.
>> I've already checked that, and it's not set.
>
>
> then you should probly set it ;)
It has the right TZ set. I checked it with date_default_timezone_get().
I changed the system wide TZ to a zone that has the -2 TZ and it works
now, but it's a lousy solution
>
> Anyway, I found out that PHP uses an internal tz database (very bad
>> IMHO) and it might be out of date.
>>
>
> what is a better alternative in your opinion; i dont know much about any
> alternatives..
How about use the tzdata that is already installed is the system?
attached mail follows:
On Feb 6, 2008 12:48 PM, Martin Marques <martin
marquesminen.com.ar> wrote:
> Nathan Nobbe escribió:
> > On Feb 6, 2008 12:13 PM, Martin Marques <martin
marquesminen.com.ar> wrote:
> >
> >>> see what you have as the value for the date.timezone ini setting.
> >> I've already checked that, and it's not set.
> >
> >
> > then you should probly set it ;)
>
> It has the right TZ set. I checked it with date_default_timezone_get().
> I changed the system wide TZ to a zone that has the -2 TZ and it works
> now, but it's a lousy solution
>
> >
> > Anyway, I found out that PHP uses an internal tz database (very bad
> >> IMHO) and it might be out of date.
> >>
> >
> > what is a better alternative in your opinion; i dont know much about any
> > alternatives..
>
> How about use the tzdata that is already installed is the system?
>
It just depends. PHP5 had the latest time zone data for the US (that
changed in 2007) long before the necessary updates were applied on any
of our systems (Windows or *nix). I'm not sure if that was because the
OS updates weren't available yet or perhaps they simply had not been
applied, but in that case it was sure nice that PHP handled the dates
correctly regardless of the OS. That said, I can certainly see an
advantage to having everything run from a well updated OS.
Andrew
attached mail follows:
Hi,
I'm building a C# application that connects to a server that has PHP scripts
on it.
We need to deliver the complete solution to a firm, the C# is no problem
because it is compiled...
But PHP is a problem bacause it is interpreted and we will have to deliver
pure, unprotected script...
Is htere a way to secoure my code so when they put it on the server, they
can't see it!
Thank You!
attached mail follows:
> I'm building a C# application that connects to a server that has PHP scripts
> on it.
>
> We need to deliver the complete solution to a firm, the C# is no problem
> because it is compiled...
>
> But PHP is a problem bacause it is interpreted and we will have to deliver
> pure, unprotected script...
>
> Is htere a way to secoure my code so when they put it on the server, they
> can't see it!
There's the Zend Encoder at www.zend.com. Though it may be called
something else now.
--
Richard Heyes
http://www.websupportsolutions.co.uk
Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free
attached mail follows:
zend encoder?
http://sourceforge.net/projects/php-screw/
google for more
bastien> To: php-general
lists.php.net> From: test1.test1
hi.t-com.hr> Date: Wed, 6 Feb 2008 12:28:12 +0100> Subject: [PHP] PHP Source code protection> > Hi,> > I'm building a C# application that connects to a server that has PHP scripts > on it.> > We need to deliver the complete solution to a firm, the C# is no problem > because it is compiled...> > But PHP is a problem bacause it is interpreted and we will have to deliver > pure, unprotected script...> > Is htere a way to secoure my code so when they put it on the server, they > can't see it!> > Thank You! > > -- > PHP General Mailing List (http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php>
_________________________________________________________________
attached mail follows:
See also:
http://www.ioncube.com/
----- Original Message -----
From: "Bastien Koert" <bastien_k
hotmail.com>
To: "Zoran Bogdanov" <test1.test1
hi.t-com.hr>; <php-general
lists.php.net>
Sent: Wednesday, February 06, 2008 2:27 PM
Subject: RE: [PHP] PHP Source code protection
zend encoder?
http://sourceforge.net/projects/php-screw/
google for more
bastien> To: php-general
lists.php.net> From: test1.test1
hi.t-com.hr> Date:
Wed, 6 Feb 2008 12:28:12 +0100> Subject: [PHP] PHP Source code protection> >
Hi,> > I'm building a C# application that connects to a server that has PHP
scripts > on it.> > We need to deliver the complete solution to a firm, the
C# is no problem > because it is compiled...> > But PHP is a problem bacause
it is interpreted and we will have to deliver > pure, unprotected script...>
> Is htere a way to secoure my code so when they put it on the server, they
> can't see it!> > Thank You! > > -- > PHP General Mailing List
(http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php>
_________________________________________________________________
attached mail follows:
> Is htere a way to secoure my code so when they put it on the server, they
> can't see it!
Short answer: NO
Long answer NO, but:
There are some products that claim they protect your code, but they
all basicly rely on "security through obscurity". A principle that is
often frowned upon by security experts. All those products make the
code harder to read, but the code is still there becouse the server
has to run it.
It all comes down to these questions:
How much do you trust your clients?
How important is your code to you?
If your code is some basic accounting database or something, just make
it clear to your clients that they are not allowed to re-use the code
(put a licence on top of each file).
If you are ashamed of your crappy code, use something like PHP Encoder
to hide this from your clients. It will probably hide all the curse
word in your comments for example.
If you really do use some hight tech, top secret NSA crypto code.
Stop distributing your code. If someone can run your code, he/she can
view, modify and copy your code. All you can do is make it harder, but
if your code is valuable enough, someone will reverse engineer it.
Floor Terra
attached mail follows:
On Feb 6, 2008 11:13 AM, C.R.Vegelin <cr.vegelin
hetnet.nl> wrote:
> ----- Original Message -----
> From: "Bastien Koert" <bastien_k
hotmail.com>
> > zend encoder?
> > http://sourceforge.net/projects/php-screw/
> >
> >
> > google for more
>
>
> See also:
> http://www.ioncube.com/
All good ideas. And in the case of Zend (and, to a lesser degree,
Ioncube), all industry standards. The problem is, decoding/decrypting
of the files has been done with some success, so if it's that big of a
deal, consider writing your own PHP module to decode your own
proprietary encoding.
Bottom line: if all you want to do is "hide" the source from
prying eyes, use one of the suggestions you've received from others.
Of those, I'd endorse Zend Encoder.
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
On 2/6/08, Richard Heyes <richardh
phpguru.org> wrote:
> There's the Zend Encoder at www.zend.com. Though it may be called
> something else now.
Pointless.
http://www.phprecovery.com/
--
Greg Donald
http://destiney.com/
attached mail follows:
On 2/6/08, Greg Donald <gdonald
gmail.com> wrote:
> On 2/6/08, Richard Heyes <richardh
phpguru.org> wrote:
> > There's the Zend Encoder at www.zend.com. Though it may be called
> > something else now.
>
> Pointless.
>
> http://www.phprecovery.com/
http://www.zendecode.com/
I'm sure there are others.
--
Greg Donald
http://destiney.com/
attached mail follows:
On Wed, February 6, 2008 5:28 am, Zoran Bogdanov wrote:
> I'm building a C# application that connects to a server that has PHP
> scripts
> on it.
>
> We need to deliver the complete solution to a firm, the C# is no
> problem
> because it is compiled...
>
> But PHP is a problem bacause it is interpreted and we will have to
> deliver
> pure, unprotected script...
>
> Is htere a way to secoure my code so when they put it on the server,
> they
> can't see it!
A clear license will go a lot farther than some technology here...
That said, there is the Zend Encoder and the ???Priada Blender??? or
somesuch.
If you Google for those, you should find more solutions as well in
comparisons and archives.
One other option.
After you get your PHP code all worked out, re-write it as a custom
PHP extension -- or even just the core of it, and send them a .so or
.dll to install.
Note that unless it's something REALLY special, it's faster and easier
for somebody to reverse engineer it just from the behaviour than to
bother to "crack" your code with a debugger and dis-assembler.
And if it IS that tricky, somebody with enough time/energy CAN
dis-assemble it and figure it out if they want to badly enough.
So, to come back to the original statement:
If you just want to keep honest people honest, a clear license that
says exactly what they can and can't do with the code is all you need,
and a lot easier for integration.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
>
> On Feb 4, 2008 2:48 PM, Jason Pruim <japruim
raoset.com> wrote:
> I got bored, so I wrote out a system to handle it. Let me know if you want the source when it's done.
Hi everybody,
I'm new to the list, but am currently working on a project where I could
use some HTML-searching stuff too. I'm not quite clever at search
algorithms, so if someone could point me to some basic functionality,
that would be great.
Thanks in advance.
Aschwin Wesselius
attached mail follows:
On Feb 6, 2008 6:58 AM, Aschwin Wesselius <get
illuminated.nl> wrote:
> Hi everybody,
>
> I'm new to the list, but am currently working on a project where I could
> use some HTML-searching stuff too. I'm not quite clever at search
> algorithms, so if someone could point me to some basic functionality,
> that would be great.
>
> Thanks in advance.
The best way to start on the list is by not hijacking someone
else's thread. ;-P
Just send a new email to the list with your topic in the "subject"
and your specific question(s) and I'm sure you'll get the answers
you're looking for pretty quickly.
And welcome to the list!
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
Hi list,
When creating a LAMP app, I always start by writing ORM myself.
It's fun but it usually takes a long time.
Besides, that always results in a toy-system,
I mean, that has not so many features, not so efficient non-bug-free.
I started to think that now is the time to throw away my rubbish
and use more effective Open source ORM.
So my question is what ORM are you using?
What ORM do you recommend?
There're lots of Web app frameworks out there
but I could't find simple ORM in PHP.
Thanks in advance.
attached mail follows:
2008. 02. 6, szerda keltezéssel 22.10-kor js ezt Ãrta:
> Hi list,
>
> When creating a LAMP app, I always start by writing ORM myself.
> It's fun but it usually takes a long time.
> Besides, that always results in a toy-system,
> I mean, that has not so many features, not so efficient non-bug-free.
>
> I started to think that now is the time to throw away my rubbish
> and use more effective Open source ORM.
>
> So my question is what ORM are you using?
> What ORM do you recommend?
> There're lots of Web app frameworks out there
> but I could't find simple ORM in PHP.
check out doctrine:
http://trac.phpdoctrine.org/
or propel:
http://propel.phpdb.org/trac/
however, these are not 'simple' ORMs.
in my opinion, doctrine is great, with lots of features and cool
documentation, but it's still heavily under development, so not at all
stable. on the other hand, propel is stable, but lacks some of
doctrine's best features (inheritance, query-result caching, etc)
greets
Zoltán Németh
>
> Thanks in advance.
>
attached mail follows:
> When creating a LAMP app, I always start by writing ORM myself.
> It's fun but it usually takes a long time.
> Besides, that always results in a toy-system,
> I mean, that has not so many features, not so efficient non-bug-free.
>
> I started to think that now is the time to throw away my rubbish
> and use more effective Open source ORM.
>
> So my question is what ORM are you using?
> What ORM do you recommend?
> There're lots of Web app frameworks out there
> but I could't find simple ORM in PHP.
>
> Thanks in advance.
>
Have a look at Qcodo. http://www.qcodo.com.
It uses code generation to create your ORM for you direct from the DB
tables. As it's code generation as opposed to run time analysis (which is
what ActiveRecord and the like use), there is no performance hit - it
literally just creates your PHP class files for you.
There is a framework aspect to Qcodo called QForms but this is decoupled
from the generated ORM so you don't have to use it if you don't want it.
HTH,
Edward
attached mail follows:
On 2/6/08, Edward Kay <edward
labhut.com> wrote:
> It uses code generation to create your ORM for you direct from the DB
> tables. As it's code generation as opposed to run time analysis (which is
> what ActiveRecord and the like use), there is no performance hit - it
ActiveRecord caches the fields query in production. A one-time query
to discover the field types is not a performance hit.
--
Greg Donald
http://destiney.com/
attached mail follows:
Am 2008-01-31 13:16:51, schrieb Nathan Nobbe:
> it doesnt let you reclaim lost tabs. nor does it save the tabs for the next
> time you
> open it. i have to pkill ff or similar to get it to ask if i want to
> restore the session.
> opera just does it.
Thats not right, since I can save the current tabs and if I reopen
firefox OR iceape they are restored. Also I have a TAB history,
which let me reopen closed tabs...
Note: Opera is no solution since it does not
run on "sparc", "arm" or "mips"...
Thanks, Greetings and nice Day
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
50, rue de Soultz MSN LinuxMichi
0033/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFHpK2wC0FPBMSS+BIRAmGHAKCcmWs7bUtcGl09hlVyy3XsJPV4PQCbBhLH
I36MwKZWF9idGg6XCjlUiUM=
=jUC6
-----END PGP SIGNATURE-----
attached mail follows:
On Feb 2, 2008 12:51 PM, Michelle Konzack <linux4michelle
freenet.de> wrote:
> Am 2008-01-31 13:16:51, schrieb Nathan Nobbe:
> > it doesnt let you reclaim lost tabs. nor does it save the tabs for the
> next
> > time you
> > open it. i have to pkill ff or similar to get it to ask if i want to
> > restore the session.
> > opera just does it.
>
> Thats not right, since I can save the current tabs and if I reopen
> firefox OR iceape they are restored. Also I have a TAB history,
> which let me reopen closed tabs...
you must be aware of some feature that i am not.
note however, that opera requires no external intervention to
make these features work.
if this is what youre talking about
https://addons.mozilla.org/en-US/firefox/addon/1859
ill check it out, but it will have a hard time competing w/ operas
elegance.
<