[PHP] Review: Function that measures the width of a text string in pixels.
I have created a function that will measure the width of a text string in pixels. It works ok. If you have optimizations, please let me know. Thanks, Jacob function txt_width ($txt) { $width = 0; $txt_len = strlen($txt); for ($n = 1; $n <= $txt_len; $n++) { switch (substr($txt, $n, 1)) { case 'l'; case '.'; case ' '; case '-'; case 't'; $width += 3; break; default : $width += 8; break; } } return $width; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Review: Function that measures the width of a text string in pixels.
M. Sokolewicz wrote: Jacob Friis wrote: I have created a function that will measure the width of a text string in pixels. It works ok. If you have optimizations, please let me know. Thanks, Jacob function txt_width ($txt) { $width = 0; $txt_len = strlen($txt); for ($n = 1; $n <= $txt_len; $n++) { switch (substr($txt, $n, 1)) { case 'l'; case '.'; case ' '; case '-'; case 't'; $width += 3; break; default : $width += 8; break; } } return $width; } the width depends on the font used (monospace or not), the kerning used, the size of whitespaces, etc. you can't say "the width of X will be Y" without knowing the font, font size, kerning, etc. I know, I had thought about that I could multiply the result according to what I know about the font. It works ok so far for my purpose, which is to measure the width of menu elements in dhtmlcentral.com's coolmenus. /Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Read PDF files with Php
Do I need PDFlib in order to read PDF files? Is there another way? Thanks, Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Read PDF files with Php
Do I need PDFlib in order to read PDF files? Is there another way? > There is a nifty tutorial on this subject over at zends.com Can I read PDF files with that? Thanks, Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] httpd runs forever
I sometimes have a httpd process that when I look at top has run for more than 100 min. Can I in some way find out why it will not stop or its url? Regards Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php5: configure --with-pear but there's no pear?
When I do configure --with-pear I would assume that pear would be available after make install, but it isn't. Any ideas? Thanks, Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php5: configure --with-pear but there's no pear?
When I do configure --with-pear I would assume that pear would be available after make install, but it isn't. Any ideas? How is it 'not available'? Did the PEAR directory/files not install? Is your system not finding them? I got it now, I think I missed some Debian packages. Thanks, Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Validate XML data
It is possible to validate a XML document with XML Schema Definition Language (XSDL). Is it possible to use XSDL in Php? Thanks, Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Validate XML data
It's possible in PHP 5, but not in PHP 4 Could you link me to the documentation? And I advise to use the most recent libxml2 libraries, since they made big improvements concerning XSD support lately It is possible to validate a XML document with XML Schema Definition Language (XSDL). Is it possible to use XSDL in Php? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php4 and php5 on the same apache server
How can I run both php4 and php5 on the same apache server? Could I do it like this: AddType application/x-httpd-php .php AddType application/x-httpd-php5 .php5 And somehow tell php5 to use application/x-httpd-php5 -- Best regards, Jacob Friis Larsen www.webcom.dk | www.journster.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Compile Php5: --with-mysql and --with-mysqli
How do I install Php5 with both --with-mysql and --with-mysqli? MySQL is 4.1.3-beta and installed as official MySQL RPM. This didn't work: ./configure --with-mysql=/usr/include/mysql --enable-embedded-mysqli ./configure --with-mysql=/usr/include/mysql --with-mysql=/usr/bin/mysql_config ./configure --with-mysql=/usr/include/mysql --with-mysqli=/usr/bin/mysql_config The last gave me a lot of errors. Thanks, Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cannot build ext/mysql together with ext/mysqli and apache2
I can only make it work, when not compiling php as a module. This works: ./configure --disable-all --with-mysqli=/usr/bin/mysql_config --with-mysql=/usr/include/mysql This doesn't: ./configure --disable-all --with-mysqli=/usr/bin/mysql_config --with-mysql=/usr/include/mysql --with-apxs2 I use: Apache 2.0.49 (Fedora Core 1 RPM) Php 5.0.0 MySQL 4.1.3-beta (MySQL RPM) Any ideas? Thanks, Jacob Georg Richter wrote: Am Mi, den 14.07.2004 schrieb Jacob Friis Larsen um 8:04: Hi! Could you show me your configure statement. I can't make it work. System Linux beethoven 2.6.5-7.95-default #1 Thu Jul 1 15:23:45 UTC 2004 i686 Build Date Jul 14 2004 09:30:39 Configure Command './configure' '--disable-all' '--with-pcre-regex' '--with-mysqli=/usr/local/mysql-4.1/bin/mysql_config' '--with-mysql=/usr/local/mysql-4.1' '--with-apxs2=/usr/local/apache2/bin/apxs' Versions: Apache 2.0.50 latest PHP5 CVS MySQL 4.1.4-beta (works with 4.1.3-beta too) Hope, this will help! /Georg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Compile Php5: --with-mysql and --with-mysqli
[quote src="doc"] If you would like to install the mysql extension along with the mysqli extension you have to use the same client library to avoid any conflicts. [/quote] I've read that too :) What does it mean? Could you correct my configure line? ./configure --with-mysql=/usr/include/mysql --with-mysqli=/usr/bin/mysql_config Thanks, Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot build ext/mysql together with ext/mysqli and apache2
How do you know it did not work? I guess you see some error messages. Could you include them with your description? Below is the output from make. There are lots of errors. I can only send some of them as this list has a limit of 10 bytes. /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x0): multiple definition of `net_buffer_length' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x0): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): multiple definition of `max_allowed_packet' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x8): multiple definition of `net_read_timeout' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x8): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0xc): multiple definition of `net_write_timeout' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0xc): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x0): In function `mysql_server_init': : multiple definition of `mysql_server_init' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x0): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x1d0): In function `mysql_debug': : multiple definition of `mysql_debug' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x1d0): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0xf0): In function `mysql_server_end': : multiple definition of `mysql_server_end' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0xf0): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x150): In function `mysql_thread_end': : multiple definition of `mysql_thread_end' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x150): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x130): In function `mysql_get_parameters': : multiple definition of `mysql_get_parameters' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x130): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x140): In function `mysql_thread_init': : multiple definition of `mysql_thread_init' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x140): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x1e0): In function `pipe_sig_handler': : multiple definition of `pipe_sig_handler' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x1e0): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x200): In function `mysql_master_query': : multiple definition of `mysql_master_query' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x200): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x250): In function `mysql_master_send_query': : multiple definition of `mysql_master_send_query' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x250): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x2c0): In function `mysql_slave_query': : multiple definition of `mysql_slave_query' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x2c0): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x310): In function `mysql_slave_send_query': : multiple definition of `mysql_slave_send_query' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x310): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x3a0): In function `mysql_enable_rpl_parse': : multiple definition of `mysql_enable_rpl_parse' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x3a0): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x3c0): In function `mysql_disable_rpl_parse': : multiple definition of `mysql_disable_rpl_parse' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x3c0): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x3e0): In function `mysql_rpl_parse_enabled': : multiple definition of `mysql_rpl_parse_enabled' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x3e0): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x400): In function `mysql_enable_reads_from_master': : multiple definition of `mysql_enable_reads_from_master' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x400): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x420): In function `mysql_disable_reads_from_master': : multiple definition of `mysql_disable_reads_from_master' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x420): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x440): In function `mysql_reads_from_master_enabled': : multiple definition of `mysql_reads_from_master_enabled' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x440): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0xf60): In function `mysql_query': : multiple definition of `mysql_query' /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0xf60): first defined here /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x6a0): In function `mysql_rpl_probe': : multiple definition
Re: [PHP] Compile Php5: --with-mysql and --with-mysqli
Curt Zirzow wrote: * Thus wrote Jacob Friis Larsen: How do I install Php5 with both --with-mysql and --with-mysqli? 1. Follow instructions at http://php.net/mysqli. Is this correct: "--with-mysqli=/usr/bin/mysql_config"? (This works: ./configure --with-mysqli=/usr/bin/mysql_config --with-apxs2) 2. Follow instructions at http://php.net/mysql, using the path to your mysql4.1 library Is this correct: "--with-mysql=/usr"? If not, how can I find out? 3. Tweak your my.cnf so the mysqlclient look at the right places. What should I tweak? MySQL is the original RPM from MySQL. Version 4.1.3-beta. Sorry, I think I need more help. I've read this: "If you would like to install the mysql extension along with the mysqli extension you have to use the same client library to avoid any conflicts.", but I do not understand the meaning of it. There is only one MySQL installation on the server. This is my configure, which fails: ./configure --disable-all --with-mysqli=/usr/bin/mysql_config --with-mysql=/usr --with-apxs2 Thanks, Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Compile Php5: --with-mysql and --with-mysqli
execute /usr/bin/mysql_config --include. It's the path without include/mysql. In that case my configure is correct: ./configure --disable-all --with-mysqli=/usr/bin/mysql_config --with-mysql=/usr --with-apxs2 Also make sure you don't have multiple libraries installed, you should install MySQL-shared-compat*.rpm I have installed MySQL-shared-compat-4.1.3-0.i386.rpm, but I still get errors. thanks, Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] building php5.0 as an apache module, with mysqli functionality
Curt Zirzow wrote: i'm trying to use the following "configure" ./configure --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc --with -mysql=/usr/include/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config - -with-ldap --with-pgsql If you read the installation at http://php.net/mysqli, you can not include two versions of mysql and mysqli client libraries. Someone made this work: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=bqcbqi%2416sr%241%40FreeBSD.csie.NCTU.edu.tw /Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Convert all named entities into numeric character references
Does anyone know of a Php funtion that can do this: http://golem.ph.utexas.edu/~distler/blog/NumericEntities.html Thanks, Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Convert all named entities into numeric character references
> > Does anyone know of a Php funtion that can do this: > > http://golem.ph.utexas.edu/~distler/blog/NumericEntities.html > Hi there! > > http://se.php.net/manual/en/function.htmlentities.php > > ? htmlentities converts to named entitites. I want it to numeric entities. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Convert all named entities into numeric character references
Thanks, I could also use Tidy and make it do the convert. Jacob On 3/9/06, Robin Vickery <[EMAIL PROTECTED]> wrote: > On 06/03/06, Jacob Friis Saxberg <[EMAIL PROTECTED]> wrote: > > > > Does anyone know of a Php funtion that can do this: > > > > http://golem.ph.utexas.edu/~distler/blog/NumericEntities.html > > > Hi there! > > > > > > http://se.php.net/manual/en/function.htmlentities.php > > > > > > ? > > > > htmlentities converts to named entitites. I want it to numeric entities. > > This is probably the simplest way of doing it; write a simple function > that translates entity names to numbers, then start an output buffer > at the beginning of your script using the function as an output > callback function. Then everything after that automatically gets > converted. > > In fact it's so simple, I'll do it for you... > > Code posted to pastebin: > >http://robinv.pastebin.com/592400 > > -robin > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php is not writing errors in logfile
I have asked Php to log errors in a file but it doesn't. error_reporting = E_ALL display_errors = Off log_errors = On error_log = /var/log/php-errors.log Any idea what's wrong? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php is not writing errors in logfile
On 10/5/05, Stephen Leaf <[EMAIL PROTECTED]> wrote: > On Wednesday 05 October 2005 08:16 am, Jacob Friis Saxberg wrote: > > I have asked Php to log errors in a file but it doesn't. > > > > error_reporting = E_ALL > > display_errors = Off > > log_errors = On > > error_log = /var/log/php-errors.log > sure PHP has write permissions to this file? No, I guess Php have the same rights as apache, and if I put the logfile in /var/log/httpd/php-errors.log it still doesn't work. > > > > > Any idea what's wrong? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php is not writing errors in logfile
On 10/5/05, Skippy <[EMAIL PROTECTED]> wrote: > Quoting Jacob Friis Saxberg <[EMAIL PROTECTED]>: > > > I have asked Php to log errors in a file but it doesn't. > > > > error_reporting = E_ALL > > display_errors = Off > > log_errors = On > > error_log = /var/log/php-errors.log > > > > Any idea what's wrong? > > Maybe that's not the right php.ini. Look at phpinfo(). Or the user that the > webserver runs as doesn't have the right to access the logfile. According to phpinfo I am using the right php.ini How can I check that the webserver have prober rights? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Php is not writing errors in logfile
On 10/5/05, Jacob Friis Saxberg <[EMAIL PROTECTED]> wrote: > I have asked Php to log errors in a file but it doesn't. > > error_reporting = E_ALL > display_errors = Off > log_errors = On > error_log = /var/log/php-errors.log > > Any idea what's wrong? Sorry, this solved my problem: error_log = /var/log/httpd/php-error.log touch /var/log/httpd/php-error.log chown apache:apache /var/log/httpd/php-error.log Thanks for your time. Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php and Ruby
Hi. How can I use Ruby with Php? My goal is to have (Independence of Presentation Logic(IoPL)). Thanks, Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Php and Ruby
> How can I use Ruby with Php? I mean Rails. sorry :) > My goal is to have (Independence of Presentation Logic(IoPL)). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php, Rails and ajax
Hello again. Is it possible to use Php, Rails and ajax via some open source system? How do you do it? The most important for me is to use Php and ajax. Thanks, Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php