[PHP] Weird results with floor compiling with -march=pentium4 -mcpu=pentium4
Hi, Just for the record. I compiled PHP 5.2.2 with CFLAGS=-O2 -march=pentium4 -mcpu=pentium4, as usual (I've done so with all the 5.x.x series, and the proc is a Pentium 4, of course) and a customer complained about weird results in one of his scripts. I isolated the problem to be related to the floor function. The problem was that it returned weird results. Sample script: ?php $nt = 100; $promrow2['uni_gifts'] = 1; $promrow2['unidades'] = 10; $calc_cnt=floor(($nt*$promrow2['uni_gifts'])/$promrow2['unidades']); print $calc_cnt; ? printed :.01 Casting to integer the value returned by floor solved the problem. I recompiled with CFLAGS=-O2 -march=i686 -mcpu=i686 and the problem was solved too. I've compiled 5.2.2 with nocona optimizations without problems in other machines, so I don't consider this a normal behavior. But report submited. Has anyone faced the same problem?. Software: PHP 5.2.2 GCC 3.2.2 Regards, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: performance.
On Tue, 26 Jul 2005, Matthew Weier O'Phinney wrote: this could be a silly question. Is there some performance penalty when using the operator [in heredoc] Try doing some benchmarks using microtime(). My gut reaction is that there shouldn't be any difference; heredoc syntax is simply another form of quoting strings. I had forgotten the heredoc name for that sintax style. I'll do some benchmarking. My reaction is the same, and even as there just one asignment, I guess the operation is faster Thanks, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] performance.
Hi, this could be a silly question. Is there some performance penalty when using the operator like this: $var =EOP add a bunch of text here and here EOP; Just curious. Thanks, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] memcached and objects.
Good morning, I would like to use PHP's memcached extension to store objects. However I keep getting the incomplete object everytime I try to operate on an object got from the cache. How can be an object stored in memcached and later recovered to work with it?. Is this possible?. I would thank you a lot if you point me to some example. Thanks in advanced. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] auto reply framework
On Sat, 2 Jul 2005, Nate Tanner wrote: I'm working on the design of a program for sending automatic messages to users, based on certain conditions. It seems like there should be some So the point is that I need to be able to set up rules for what each message contains, and when each message should be sent, based on selected conditions. Is there anything out there (PHP/Mysql solution preferably) that might give some help with something like this? Hi Nate, maybe something here could help you: http://freshmeat.net/search/?q=membershipsection=projectsGo.x=0Go.y=0 I have done similar things with perl (could be also php from cli) and crontab, and a web interface for setting up things, but all handmade. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] memcached and objects.
On Sat, 2 Jul 2005, Jochem Maas wrote: I would like to use PHP's memcached extension to store objects. However I keep getting the incomplete object everytime I try to operate on an load the class definition BEFORE you try to extract the object from the cache. Thanks to Jochem and Brad for your answers. I see now where my problem is. I forgot to post that the objects I want to cache are recordsets generated by Adodb. However, since the recordset class is generated by Adodb with a (I guess) factory class, and the object's class is not defined in a file with the same name as the class, how to figure out which file to load :-S ? ... I've googled to see if there's some sample code for caching adodb recordsets, without success so far. Is someone aware of some class to cache Adodb recordsets in memcached?. Thanks again, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SCORM PHP
Hello, I have searched freshmeat/hotscripts/google/... for some class or simple PHP script (not a full LMS) to display SCORM content, without success. Does someone know about this topic or if such a class/script exists?, thanks a lot in advanced for your help. Regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Conflicts between c-client and MySQL
Hello, I'm trying to compile with: UW-IMAP's c-client 2004, MySQL 4.1.7, php-5.0.3RC2 and php-5.0.2, configure somethingmorehere --with-imap --with-mysqli, and I get this: /usr/lib/libc-client.a(misc.o)(.text+0x8a4): In function `hash_reset': /home/rodolfo/software/imap-2004a/c-client/misc.c:278: multiple definition of `hash_reset' /usr/lib/mysql/libmysqlclient.a(hash.o)(.text+0x130): first defined here /usr/bin/ld: Warning: size of symbol `hash_reset' changed from 94 to 89 in /usr/lib/libc-client.a(misc.o) collect2: ld returned 1 exit status make: *** [libphp5.la] Error 1 Any help is appreciated, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session file not written *solved*, but session variables *still* messed up.
On Fri, 12 Nov 2004, Klaus Reimer wrote: Rodolfo wrote: The weirdness comes when in one frame the script will print Agent Smith while in the other frame of the same frameset the script which loads on it will print Thomas Anderson... On the other hand: Have you checked that your disk has enough room for more sessions? Maybe you are working on the bleeding edge of your harddisk capacity. Hi, I found the cause for this message: --- Nov 15 12:22:02 http2 httpd: PHP Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/tmp/php) in Unknown on line 0 --- this is the cause: --- Nov 15 12:22:02 http2 httpd: PHP Warning: Unknown(): The session id contains invalid characters, valid characters are only a-z, A-Z and 0-9 in Unknown on line 0 --- and the configuration lines which cause these messages, are, IMO, these: --- session.entropy_length = 16 session.entropy_file = /dev/urandom --- Maybe some PHP or Zend guru could confirm this?. On the other hand, it is still not clear why different session data is appearing in different frames. Could some cache software (ie. Squid) being messing up the cookies?, or maybe MMCache? :S Thanks. Regards, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Maintaining sessions across multiple sites
On Fri, 30 Jul 2004, Tom Rogers wrote: RD I'm in the process of building an application that has an adminstration RD back-end shared by multiple sites. I need to maintain a persistent session msession is designed for just this purpose how reliable msession is?. I'm interested on it too. Regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with PEAR DB MySQLi
Hi, I'm trying to use PEAR's DB class with the new PHP 5 MySQLi support on MySQL 4.1.3, using this example from the PEAR's docs (with my parameters of course). I'm getting DB unknown error messages after the query. The same query from the mysql client works fine, there are no connection problems... anyone has tried PEAR with mysqli?. ?php // Create a valid DB object named $db // at the beginning of your program... require_once 'DB.php'; $db = DB::connect('mysqli://prueba:[EMAIL PROTECTED]:3306/mibase'); if (DB::isError($db)) { die($db-getMessage()); } // Proceed with a query... $res = $db-query('SELECT * FROM users'); // Always check that result is not an error if (DB::isError($res)) { die($res-getMessage()); } ? result: DB Error: unknown error Regards, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Compilation problem with PHP5 and MySQL 4.1
Hi, I know that this should go to the php-inst ml, but I can not resubscribe (the error in the P.S.). I'm trying to install PHP 5 + MySQL 4.1.3 in Apache 1.3 and I'm getting these messages: (tons of first defined messages before, just pasted a sample below) ... /usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x260): first defined here /usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x350): In function `net_write_command': : multiple definition of `net_write_command' /usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x350): first defined here /usr/lib/mysql/libmysqlclient.a(net.o)(.text+0xa60): In function `my_net_read': : multiple definition of `my_net_read' /usr/lib/mysql/libmysqlclient.a(net.o)(.text+0xa60): first defined here collect2: ld returned 1 exit status make: *** [libphp5.la] Error 1 I have installed MySQL from RPM's built from the official SRPMs. Any help is appreciated. Rodolfo. P.S. the ml subscription system in php.net is failing due to this: Warning: fsockopen(): php_hostconnect: connect failed in /local/Web/sites/phpweb/include/posttohost.inc on line 29 Warning: fsockopen(): unable to connect to master.php.net:80 in /local/Web/sites/phpweb/include/posttohost.inc on line 29 We were unable to subsribe you due to some technical problems. Please try again later. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Framework in PHP?
Hello, which free (as in beer) framework writen in PHP (OO) would you consider the best for developing large web applications?. I was looking at Seagull (http://seagull.phpkitchen.com/)... I would appreciate your comments on this and other frameworks. Thank you, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Code still showing up :(
Hi, I'm still having the same problem, the PHP code is sometimes not interpreted, but passed as text/plain to the browser. The MIME type is configured correctly, and once (in the master httpd.conf). I even recompiled Apache. The system: RedHat 6.2 (ancient, I know) with Apache 1.3.27 and PHP 4.2.3. My MIME type defs: AddType application/x-httpd-php .php .php4 .php3 .phtml .html AddType application/x-httpd-php-source .phps The module loads correctly, and no error is shown in the logs. The problem happens mainly with Horde/IMP (I'm using Horde's PEAR, BTW). I guess that everything started when Perl was upgraded from 5.6.0 to 5.8.0, but I can't see any connection. Any idea is appreciated. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code appearing suddenly!.
On Tue, 17 Dec 2002, Matthieu Le Corre wrote: look at your apache httpd.conf file maybe php type is not correctly definy ... i've had the ame pb ... the mime type was definied twice ;) Bad luck, the code is still appearing randomly. The script is parsed correctly if the page is reloaded :( Thanks anyway :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Code appearing suddenly!.
Hi, I've just recompiled PHP 4.2.3 on RedHat w/Apache, after having upgraded from Perl 5.6.0 to 5.8.0 (I had to disable mod_perl for now, due to incompatible libraries). But now something weird is happening: sometimes as a page with PHP code loads in the browser, it's not processed by PHP, but the PHP code is shown (!), and the weird part of the problem is that sometimes the very same page gets executed correctly! (no code is displayed, and of course no modification is done in httpd.conf or mime types, etc.). Any idea of the cause of this weird problem?. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Per instance disable_functions in CGI mode
Hi, some weeks ago I asked if it was possible to have a per apache-virtualhost disable_functions list. Rasmus answered that this is not possible since the interpreter is initialized once, and it'd be too expensive to reload the config. But, what about PHP as CGI?. I guess the disable_functions parameter still applies for the php.ini only, but what if I create several php binaries, each one with a different path to php.ini (kind of a mess if I have several virtual hosts, I know, but I only wanna know if this setup is possible :-) ). I guess that I could have then one disable_functions list per CGI binarie, right?. I know that I'd need to prepend the #!/.../php line to every script, but only once (I would not run /cgi-bin/php.cgi). Regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Deleting HTTP auth...
Hello list, Is it possible to delete the data from an Apache's HTTP authentification directly from a PHP script?. I know that the username/password pair is stored in two variables which are sent by the client to the server, right?. is it possible to alter them from PHP¿?. Thanks a lot, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Problem: ereg doesn't work ok (?).
On Thu, 20 Sep 2001, * RzE: wrote: This sometimes work, but sometimes it doesn't randomly, even with the same (apache-1.3.20, rh-7.1) and it's the same. Any help is appreciated. Thank Ehhh... works fine here! Dunno what's wrong. Don't you do anything almost a complete year using the link it produces. No prob at all. I noticed something I haven't before: I'm generating a RPM for php-4.0.6 which is what I'm installing, but using the .spec file from the 4.0.4 which comes with RedHat. Well, in the configure it had --with-regex=system. I removed this option, recompiled, and the regex'es seem to be working fine now. The --with-regex=system comes by default in the RedHat RPM for PHP. Thank you. Rodolfo. P.S. $yesternews = date(Y-m-d, mktime(0,0,0,$regs[2],$regs[3]-1,$regs[1])); Indeed. Cool, thanks :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Globals and HTTP_SESSION_VARS variables.
Hi, Is here anyway to make a variable like $var not the same than $HTTP_SESSION_VARS[var], when register_globals=1?. (where $var is in the script scope). I read in a changelog that this is relatively recent (make $var the same than $HTTP_SESSION_VARS[var]). Thank you. Regards, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP vs M$.NET C#?
On Wed, 19 Sep 2001, Christian Reiniger wrote: Not at all I'd guess. C# is MS's reaction to Java, which has been around for quite some years now. And there's nothing new / innovative in C# Indeed, its their reaction against the lawsuit which MS lost. So, if they cannot have Java, they do thei own language, and with our bad luck and their marketing, C# will prevail. PHP would be in the level of ASP. Regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Problem: ereg doesn't work ok (?).
On Tue, 18 Sep 2001, * RzE: wrote: and get DD-MM-, but with well formed -MM-DD it doesn't match!. Is this a bug?. It would help if you send the code you're using, 'cause we can't see what you're doing now. FAFAIK it should just be possible. See the Sure: --- start --- $datenews = urldecode($datenews); // just in case, but it's the same // without this line and the one below. $datenews = trim($datenews); if (!ereg(([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}), $datenews, $regs)) { echo Duh! that is not a date, u kiddie: $datenews.; exit; } else echo Cool! it is a date. Continue the proggie.; --- end --- where $datenews is passed as a get variable, which is obtained with this: --- start --- // the $regs array comes from the ereg expression above (the one which // doesn't work as expected). $timestamp = mktime(0,0,0,$regs[2],$regs[3],$regs[1]); $yesterday = $timestamp - 86400; // one day before... that's yesterday :) $yesternews = date(Y-m-d,$yesterday); // here I pass the new datenews to myself: print a href=\$PHP_SELF?datenews=.urlencode($yesternews).\Older news/a\n; --- end --- This sometimes work, but sometimes it doesn't randomly, even with the same date both times, and the worst thing is that the failure notice prints the right date in the right format. Now I went back to php-4.0.6 (apache-1.3.20, rh-7.1) and it's the same. Any help is appreciated. Thank you. Regards. R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Problem: lost session id when htaccess'ing.
On Tue, 18 Sep 2001, Chris Lee wrote: - you have cookie support on or off ? - you using any header redirects ? (you have to manually add the SID to URI's) Sorry for the lenght of this mail. PHP compiled with --enable-trans-id, so PHP adds SID to the URL. session.use_cookies = 0, session.referer_check =, session.auto_start = 1, session.name = SID Having this doc tree: /index.html | \___ systems/index.html |___ .htaccess --- /index.html --- !-- where systems/ is htaccess protected, using a hacked version of mod_auth_mysql -- !-- here PHP attaches the first SID (supposed to be taken by systems/index.html automagically, as session.auto_start = 1 -- a href=systems/index.htmlEnter/a --- /index.html --- Now: --- systems/index.html --- ?php if ($HTTP_SESSION_VARS[inside] != 1) // register all the session variables, etc. ? frameset cols=100,* frame src=menu.html !-- here php attaches the *new* SID, not the -- !-- passed from /index.html -- frame src=main.html /frameset --- systems/index.html --- Do I need to use the SID constant with session_id() to set the first session ID? (I mean, the one from the href who taked me to the systems/ directory). Thanks, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problem: lost session id when htaccess'ing.
Hello, I have a problem with sessions: I have php with sessions autostarting, compiled with transid support. I have a homepage with a link to another page protected via Apache's htaccess. Well, the href's in the homepage get the correct SID=md5 session id, then I click the link, I give login and password, Apache checks and accepts the data, but then in the next page I get a new session_id value!! (as if the SID passed in the URL were being lost!). I guess this is not normal. What can I do?. Many thanks in advanced. Rodolfo. P.S. apache-1.3.20, custom mod_mysql_auth, php-4.0.8-dev (latest snapshot, 4.0.6 had a bug in the imap code, and I haven't returned to 4.0.5 yet). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problem: ereg doesn't work ok (?).
Hello, I have a problem with ereg: following the example from the documentation (see the ereg page in the manual), I'm using it to parse a -MM-DD date and get DD-MM-, but with well formed -MM-DD it doesn't match!. Is this a bug?. Regards, Rodolfo. php-4.0.8-dev (maybe the problem is due to the dev, but I'd like to confirm it). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sessions and img src=...
Hi there, I have a problem. I am trying to use a simple php script to display a JPEG from a "protected" catalog (the image files are out of the web tree). It's called from an IMG tag, like this: --- main file --- ?php session_start(); ? html ... ?php session_register("imgname"); $HTTP_SESSION_VARS[imgname] = "something.jpg"; print "img src=\"viewer.php?".session_name()."=".session_id()."\""; ? --- In viewer.php I use session_start() to resume the current session. However this doesn't work at all. Is there any restriction for sessions when you call the script like I'm doing?: --- viewer.php -- ?php session_start(); function LoadJPEG($imgname1) { $im = @ImageCreateFromJPEG ($imgname1); if (!$im) { $im = ImageCreate (150, 30); $bgc = ImageColorAllocate ($im, 255, 255, 255); $tc = ImageColorAllocate ($im, 0, 0, 0); ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc); ImageString($im, 1, 5, 5, "Error loading $imgname1", $tc); } return $im; } Header("Content-type: image/jpeg"); // here $HTTP_SESSION_VARS[imgname] is empty... :( $im = LoadJPEG("/cat/$HTTP_SESSION_VARS[imgname]"); ImageJPEG($im); ImageDestroy($im); ? --- Any help is appreciated. Regards. Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Silly sessions problem.
Hello list, I just can't make sessions work. This is driving me mad, I'm sure it's something silly, but maybe my headache made me a fool :P :) ... could you please tell me what's wrong here?. hello.php has a link to next.php: --- start of hello.php --- ?php session_start(); session_register("hello"); $hello = "Hello World!"; ? html headtitle/title/head body ?php print "a href=\"next.php\"$hello/a"; ? /body /hmtl --- end of hello.php --- -- start of next.php ?php // following the manual, I need to call session_start to resume the // session I started at hello.php (?) session_start(); ? html headtitle/title/head body ?php print "Hello is set to: $HTTP_SESSION_VARS[hello] - $hello"; ? /body /html --- end of next.php --- Now I click on the hyperlink and get a new cookie (produced by call to session_start() in next.php). Using PHP4.0.4pl1 (with --enable-trans-id), Apache, and the linux version of ns navigator as browser. Thank you!, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Silly sessions problem.
I just can't make sessions work. Now this is strange! I copied exactly the same scripts I posted to my win98SE box running Apache 1.3.19 and PHP 4.0.4pl1 and they worked!. Which could be the reasons for the sessions not to work?. Do they work transparently for name based virtuals, don't they?. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] deleting cart items on session expire
On Fri, 16 Feb 2001, Jason Brooke wrote: However, there's no necessity to have the cgi version if you already have the modular version. All that is needed is to call the appropriate script No there's not - I think that goes without saying though. install' - then you can use this awesome tool from the command line without having to invoke a http request to your webserver usng a third-party tool. And add to this that then you can place the script you want to run out of the web tree, just in case you run something sensitive :) My 2 cents. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mail-Encryption
On Thu, 8 Feb 2001, Richard Lynch wrote: Maybe you can create a custome keyring for just the web-usage of public keys only... Hum... I wouldn't like it, anyway. Hmmm, is there any other way to pass "stdin" to an external program, other than using echo and a pipe?. I've also tried by placing echo and gpg in the php "exec dir" and chown'ing them to the uid.gid of the php script, and it didn't work. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mail-Encryption
On Fri, 9 Feb 2001, Christian Reiniger wrote: This returns echoes the part after the | in safe-mode. echo only outputs something. it doesn't return anything. Yup, grammar error, I meant "prints to stdout" :) Write $comm = "$data | " . $this-gpg_command; Didn't work that way :( and: $this-gpg-kommand is an illegal (no minus in identifiers!) Certainly, my typo in the post :) Thank you. Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mail-Encryption
On Thu, 8 Feb 2001, Richard Lynch wrote: You can find a long-winded post from me a year or two ago about my trials and tribulations (and a *lot* of help from others to get me going). I found a pgp class and took parts of it to work with gpg, but it doesn't work in safe-mode. I'm using this pipe to pass the data to encrypt to gpg: $comm = "echo '$data' | $this-gpg-commmand"; $fd = popen("$comm","r"); if (!$fd) { return -2; } $encrypted = ""; while (!feof($fd)) { $encrypted .= fgets($fd,4096); } pclose($fd); This returns echoes the part after the | in safe-mode. How could this work in this mode?. Thank you. Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] popen in safe_mode with pipe
Hello, I need to encode some text using GPG in a PHP program. I've a class wich uses popen like this: //--- start --- // parameters to gpg omited... $command = "echo '$text' | gpg snip"; $fd = popen("$command","r") if (!$fd) { return -2; } $enc = ""; while (!feof($fd)) { $enc .= fgets($fd,4096); } pclose($fd); //--- end --- That's with PHP4. It works ok in non-safe-mode, but with safe-mode turned on it doesn't. I'd like to use safe mode. Does anyone know a better (or correct) way to open this kind of pipe under safe_mode? (I've read a comment in the manual telling about opening the pipe for read-write mode, but it seems not to work wit the echo stuff in the first part of the command). Thank you. Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]