[PHP] odbc_connect() without user and password

2011-06-21 Thread Marten Lehmann
Hi, I'd like to specify the credentials rather in the application specific .odbc.ini than in the source code. I also don't like to create config file parsing overhead. Why isn't the the user and password parameters in odbc_connect() optional? The unixODBC test tool isql works fine without sp

Re: [PHP] Re: mysqlnd and LOAD DATA INFILE

2011-06-20 Thread Marten Lehmann
This is a PHP list Exactly. And it is the switch from --with-mysql=/usr to --with-mysql=mysqlnd (the PHP native MySQL driver) during the build that caused the problem. And there is no alternative to building current PHP versions with mysql support than with mysqlnd, because the mysql 5.5.x l

Re: [PHP] Re: mysqlnd and LOAD DATA INFILE

2011-06-20 Thread Marten Lehmann
Hello, What does that mean? It generates an error? It executes without error but the data isn't loaded? Try a test on the command line and see what you get. when calling mysql_error() the message "The used command is not allowed with this MySQL version" is returned. I thought maybe knows b

[PHP] mysqlnd and LOAD DATA INFILE

2011-06-20 Thread Marten Lehmann
Hello, we recently updated our mysql client libs to mysql-5.5.13 and since it was impossible to rebuild PHP 5.2.x and PHP 5.3.x with this new mysql release, we rebuilt PHP with --with-mysql=mysqlnd and ---with-mysqli=mysqlnd. General mysql commands work fine, but one of our clients reported,

Re: [PHP] constants STDOUT, STDERR, STDIN not working in 5.2.x?

2010-03-24 Thread Marten Lehmann
Hello, dan...@daniel-laptop:~$ php test.php> /dev/null Error 1 Error 2 dan...@daniel-laptop:~$ ./src/php-5.2.12/sapi/cli/php test.php> /dev/null Error 1 Error 2 well, using php-cli instead of php-cgi, this finally worked: But why doesn't it work with php-cgi? That's a binary that is calle

[PHP] constants STDOUT, STDERR, STDIN not working in 5.2.x?

2010-03-23 Thread Marten Lehmann
Hello, I found different code examples like this, which use the file handle STDERR just like this: Also, the PHP documentation of input/output streams (http://php.net/manual/de/wrappers.php.php) says: "It is recommended that you simply use the constants STDIN, STDOUT and STDERR instead

Re: [PHP] Filtering all output to STDERR

2010-03-23 Thread Marten Lehmann
Have you tried with http://dk2.php.net/manual/en/function.error-reporting.php or just the @ operator? Yes. But this does not work, because error levels and the @ operator only relate to errors thrown by the PHP runtime and have nothing to do with STDERR. But I need a way to close the STDERR

Re: [PHP] Filtering all output to STDERR

2010-03-22 Thread Marten Lehmann
Hello, You could consider suppressing errors for the duration of the problematic call yes, but how? Regards Marten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Filtering all output to STDERR

2010-03-22 Thread Marten Lehmann
Hello, we have a strange problem here: - Our ISP is merging STDERR and STDOUT to STDOUT - We are calling a non-builtin function within PHP 5.2 which includes a lot of code and calls a lot of other functions - When calling this function, we receive the output "Cannot open " on STDERR. But since

Re: [PHP] mysqli, prepare and fetch_row

2008-10-23 Thread Marten Lehmann
Hi, Kyle Terry wrote: Why don't you want to bind the results? thats poor programming style and bad performance (dozends of bind calls). Since there is a method fetch_row(), then why shouldn't I use it? It is a bit strange that I cannot find any example for its use besides in conjunction wit

Re: [PHP] mysqli, prepare and fetch_row

2008-10-22 Thread Marten Lehmann
Hi, You prepare the statement, execute it then use ->fetch() to get the data. but the documentation says, that ->fetch() is only to fetch data to variables that have been bound with bind_result() before. But I want to use fetch_row() instead. Regards Marten -- PHP General Mailing List (ht

[PHP] mysqli, prepare and fetch_row

2008-10-22 Thread Marten Lehmann
Hello, I have a small piece of code where I'm trying to use mysqli with a prepare-statement. I don't want to bind variables for the fetch, instead I want to use something like list($question) = $stmt->fetch_row(); And this fetch_row should exist according to the documentation. But while mys

Re: [PHP] SoapClient and arrays

2008-08-05 Thread Marten Lehmann
Hello, What about $response->key ??? What does that give? It seems to me, that $response->key will be a public property of the stdClass? thanks, this works fine. Regards Marten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] SoapClient and arrays

2008-08-04 Thread Marten Lehmann
Hello, I'm calling a webservice that is described by a WSDL-URL using the PHP-builtin Soap client. This works fine in general. But although the response is received correct, the variable type is wrong. According to the WSDL file, the response is defined like this: type="s:bool

[PHP] strange string evaluation

2008-07-31 Thread Marten Lehmann
Hello, with PHP 5.0.x this two lines of code returned "{TEST}": $var = "TEST"; print "\{$var}"; But with PHP 5.2.x, the same code returns "\{TEST}" If I remove the backslash: $var = "TEST"; print "{$var}"; then just "TEST" is return (without any brackets). What is the recommended way for PH

[PHP] accessing variables within objects

2008-07-30 Thread Marten Lehmann
Hello, I'm using some php-classes which worked fine with php-5.0.4. Now I tried to upgrade to php-5.2.6, but the classes give a lot of errors. If I set error_reporting(E_ALL); I see messages like Notice: Undefined property: FastTemplate::$main in /whereever/inc.template.php on line 293 No

[PHP] php.ini and command line

2008-06-23 Thread Marten Lehmann
Hello, within a CGI-wrapped hosting environment, we are calling PHP as command line interpreter (not cli). This works fine, except one thing: Settings from parent php.inis are not inherited. This is very annoying. Lets say, there is a script /user/123/index.php and some libraries in /user/123

[PHP] Which simple XML functions to use?

2007-06-05 Thread Marten Lehmann
Hello, mostly dealing with XML through the Perl-module XML::Simple I'm looking for a simple solution within PHP. PHP4 and PHP5 is available but the DOM XML-stuff seems to be bloated. What I'm looking is a function that receives an XML-document as a string, which parses the document which all

[PHP] problem with shared object file

2007-04-26 Thread Marten Lehmann
Hello, I'm trying to include a shared object file with the function dl(). But I always get: Warning: dl() [function.dl]: Unable to load dynamic library '/homepages/xyz/util.so' - /homepages/xyz/util.so: cannot open shared object file: No such file or directory in /homepages/xyz/test.php on l

Re: [PHP] local php.ini not recognized in php 5.1.x?

2006-09-04 Thread Marten Lehmann
Hi, I have also been trying to figure this out. Have you came to any conclusions? I have done some searching and so far haven't found any answers. Is there anyone else on the list that can shed some light on this? noone seems to know but the problem still exists, so I filed a bug report: ht

[PHP] local php.ini not recognized in php 5.1.x?

2006-09-02 Thread Marten Lehmann
Hello, we switched from php 5.0.6 to 5.1.6. php is running as CGI. We have a global php.ini in the /lib directory of the php installation with settings that are valid for all users. In php 5.0.6 (and previous php releases) additionally the local php.ini in the directory of the executed php-script

[PHP] --with-openssl on x64

2006-08-22 Thread Marten Lehmann
Hello, openssl is compiled for x86 on my system, so the libs are in /usr/lib64 rather than /usr/lib. But configure only looks in /usr/lib and gives me configure: error: Cannot find OpenSSL's libraries How can I change this? Regards Marten -- PHP General Mailing List (http://www.php.net/) To

[PHP] htmlentities() with utf8

2006-05-04 Thread Marten Lehmann
Hello, I want to use htmlentities() with UTF-8, which I can set with the third parameter. But to use the third parameter, I have to provide the second parameter. Currently the default for the second parameter is ENT_COMPAT. But as this might change, I don't want to call htmlentities with htm

[PHP] idn-functions in PHP

2006-05-03 Thread Marten Lehmann
Hello, is there any function in PHP which binds to libidn? I found only a PEAR-project, but PEAR-projects are often beta and not as stable as PHP-builtin functions. Regards Marten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] one-liner with strtolower and array_walk()?

2006-03-29 Thread Marten Lehmann
Hello, is it possible to write a one-liner like this: $uppercase = array("ONE", "TWO"); array_walk($uppercase, "strtolower"); print_r($uppercase); I don't want to do a foreach-loop on each element, putting the lowercase in a new array and returning this. Is there a nicer way? Regards Marten

[PHP] how to calculate with dates?

2005-12-22 Thread Marten Lehmann
Hello, I'm used to work with Date::Calc in Perl. How can I calculate with dates in PHP, like adding an hour or a year to a date? Regards Marten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Caucho Resin adds PHP

2005-12-20 Thread Marten Lehmann
Hi, has anyone read this: http://www.theserverside.com/news/thread.tss?thread_id=38144 The Java-implementation of the PHP-spec is announced to be six times faster than mod_php itself. Regards Marten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/

Re: [PHP] ob_start changed from php4 to php5?

2005-08-19 Thread Marten Lehmann
Hello! I'm also guessing that it's the LAST line of the file with the "encodeDomain" function in it that you "include" in your test.php I'm also guessing that there's a NEWLINE character after the final ?> in that file on your 5.0.4 box, but that NEWLINE character is *NOT* there on your 4.0 box

[PHP] ob_start changed from php4 to php5?

2005-08-17 Thread Marten Lehmann
Hello, I have a function catching the output of a script: function encodeDomain ($domain) { ob_start(); system("echo '$domain'"); $output = ob_get_contents(); ob_end_clean(); } And I have a php-script using this function: http://www.php.net";); ?> While this w

[PHP] posix_getgroups() and effective grooup id's

2005-03-09 Thread Marten Lehmann
Hello, while I can use posix_getgroups() to get groups additional to the posix_getgid() value, I don't know which function to use to find out the groups additional to posix_getegid(). There's no posix_getegroups() function. Regards Marten -- PHP General Mailing List (http://www.php.net/) To uns

[PHP] PATH_INFO empty, ORIG_PATH_INFO correct

2005-01-25 Thread Marten Lehmann
Hello, I'm using PHP as CGI (not through Apache-action, but she-bang line containing the path to php). When I'm calling http://test.com/phpinfo.php/a/variable/url PATH_INFO should contain "/a/variable/url". I checked this with a perl-script, which printed out all environment variables and so I k

Re: [PHP] php5 --enable-soap compile error

2005-01-25 Thread Marten Lehmann
Hello, Try posting the error messages and your exact configure line to php-install for the maximum odds of a useful response. the configure line is as follows: CFLAGS="-I/usr/kerberos/include" ./configure \ --prefix=/webserver/php-5.0.3 \ --enable-bcmath \ --enable-calendar

Re: [PHP] php5 --enable-soap compile error

2005-01-24 Thread Marten Lehmann
Is noone compiling PHP5 on its own, but just using preconfigured rpm's? Can't a developer og php have a look on this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php5 --enable-soap compile error

2005-01-22 Thread Marten Lehmann
Note: the problem seems to start a bit earlier: gcc -Iext/soap/ -I/usr/src/redhat/BUILD/php-5.0.3/ext/soap/ -DPHP_ATOM_INC -I/usr/src/redhat/BUILD/php-5.0.3/include -I/usr/src/redhat/BUILD/php-5.0.3/main -I/usr/src/redhat/BUILD/php-5.0.3 -I/usr/src/redhat/BUILD/php-5.0.3/Zend -I/usr/include/lib

[PHP] php5 --enable-soap compile error

2005-01-22 Thread Marten Lehmann
Hello, if I'm compiling php5.0.3 with --enable-soap on a redhat enterprise linux 3 system I get an error almost at the end: gcc -Isapi/cgi/ -I/usr/src/redhat/BUILD/php-5.0.3/sapi/cgi/ -DPHP_ATOM_INC -I/usr/src/redhat/BUILD/php-5.0.3/include -I/usr/src/redhat/BUILD/php-5.0.3/main -I/usr/src/red

[PHP] --disable-url-fopen-wrapper gone?

2004-10-05 Thread Marten Lehmann
Hello, one account of a user on our webserver was compromised using a feature of fopen to load external sources. As of the documentation, there shall be a configure option called "--disable-url-fopen-wrapper". Unfortunately, this option doesn't seem to exist in 4.3.9. How can I set a default fo

Re: [PHP] Re: how to load extensions outside the extension_dir

2004-09-12 Thread Marten Lehmann
Hello, You can't, It's a security thing. this doesn't make sense. When PHP is running as CGI, everyone can put it's own php.ini in the same directory as the PHP-script. This will overwrite all settings of the main php.ini. This works as described, but I don't want to put my own php.ini for that,

[PHP] how to load extensions outside the extension_dir

2004-09-10 Thread Marten Lehmann
Hello, I need to load extensions with dl() within PHP running as CGI. But as this is a shared hosting environment, I don't have access to the extension_dir. Anyway, dl() prepends /lib/php/extensions/ --ZEND_MODULE_API_NO if I'm calling dl("myext.so"); even if I'm starting with a slash. How can

[PHP] preg_match_all but no preg_replace_all?

2004-08-10 Thread Marten Lehmann
Hello, I want to be sure, that preg_replace replaces all matches. But it doesn't accept the /g modifier. And anyhow, there's no preg_replace_all like there is an preg_match_all. Will preg_replace replace everything by default? Regards Marten -- PHP General Mailing List (http://www.php.net/) To

[PHP] no select()-function?

2004-08-09 Thread Marten Lehmann
Hello, I'm missing the select-function in PHP. It's a low-level function call to the same-called C-function and also available in Perl. I need this for nonblocking socket calls. Which function within PHP do I have to use instead? Regards Marten Lehmann -- PHP General Mailing

[PHP] perl LWP for PHP?

2004-07-27 Thread Marten Lehmann
Hello, I'm familiar with perl's LWP library. Today I searched through the PHP documentation, but the only thing I found that was somewhat similar to LWP was file() and some socket-functions to do http-GET/POST calls to a foreign server. Are any higher level functions available so I don't have t

Re: [PHP] Apache 2 and PHP for Production?

2004-07-27 Thread Marten Lehmann
Hello, And following the last line - I'm still running Apache2 with PHP5 on Windows on an increasing number of sites, without a single problem to date ;) I switched to Apache 2 and PHP 5.0.0 a week ago and hand no problems so far (several hundred thousand hits each day). Apache 2 is running in

Re: [PHP] Apache 2 and PHP for Production?

2004-07-19 Thread Marten Lehmann
Hi, I just wanted to post almost the same question: PHP for Apache 2 is idling around for years now. configure --with-apxs2 is still marked as [EXPERIMENTAL] and the documentation still warns: "Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows." What is t

[PHP] how to enable utf-8 in php?

2004-07-14 Thread Marten Lehmann
Hello, PHP seems to handle all strings as ISO-8859-1 by default. How can I tell PHP to work with strings in UTF-8 format? This is important for sorting and e.g. htmlentities(). Regards Marten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php as cgi with static libraries?

2004-02-19 Thread Marten Lehmann
that's what I already did (--enable-static=db4), but after that a 'ldd php' still showed me references to libdb.so. I don't want to build php with absolutely no dynamic libaries, only certain libaries shall be compiled in statically. Still no answer? Is noone experienced enough in the building-p

Re: [PHP] php as cgi with static libraries?

2004-02-16 Thread Marten Lehmann
Hello, You will need to build php yourself, take a look at configure --help: $ ./configure --help | grep static --enable-static[=PKGS] build static libraries [default=yes] that's what I already did (--enable-static=db4), but after that a 'ldd php' still showed me references to libdb.so. I don

[PHP] php as cgi with static libraries?

2004-02-15 Thread Marten Lehmann
Hello, when I'm building php as a cgi-module, a 'ldd php' shows a list of some libraries, that are linked in dynamically. How can I link some of them statically into the php-binary? I can't rely of external libs in some cases. Regards Marten -- PHP General Mailing List (http://www.php.net/) To