PHP On Solaris (2.6) And Integer Overflow
I have PHP version 4.4 installed on a Soaris 2.6 system and I'm getting
strange results doing math/boolean operators. I have a hashing
algorithm that does multiplication, bitwise operations and mod() calls
interatively on the characters of a filename. On a linux platform the
multiplications start to overflow (as I expect) and the overflow is
just dropped. The lower three bytes are masked off like this:
$result = $result & 0x00FFFFFF;
and the loop continues. On the Solaris platform the multiplication
fails very quickly in the loop, and it looks like the overflow bits are
wrapped around onto the lower order bytes, eventually I end up with an
interger value of 0x00FFFFFF because of the masking above. To solve the
problem I had to compile the gmp_* function support into PHP and work
with the gmp_* family of functions.
View Complete Forum Thread with Replies
Related Forum Messages:
Fatal Error: Possible Integer Overflow In Memory Allocation
GGot a bizzare issue with PHP 5.0.2/Apache constantly generating variations of the following error: "Fatal error: Possible integer overflow in memory allocation" At first I traced it through to any line using the $_SERVER[] command and so replaced it with $HTTP_SERVER_VARS[]. This worked fine, however now I seem to get the issue whenever I use a "preg_match" command. Is there some greater global variable/configuration item that I need to sort out to stop this from happening or is it something else? Code:
View Replies !
Separate A Non-integer Into Integer And Fraction
Is it possible to grab a non-integer number and separate it into an integer and numbers after the decimal place? (I'm not a maths expert, is there a name for the numbers after the decimal place?) For example, I need to perform 15/12 = 1.25, then store 1 and 0.25 in separate variables.
View Replies !
CSS Overflow
Im having some problems with the CSS overflow property with Mozilla, and the new IE7 beta 2. Currently my main layer is set to visible, which works fine in standard, ie, but not in mozilla, mozilla does not stretch the layer, and just ignores the clipping and goes beyond it. I've tried all the other options and the only one that would give full functionality but would look crap would be the scroll bars.
View Replies !
Mysql_query Overflow ?
I would like to suggest you some refelxion about this : I run this simple code : .... $res = mysql_query ($requete, $connexion) or die(mysql_error()); while (is_object($elt = mysql_fetch_object($res) ) ) { .... } with in $requete a SQL commande that I have run it on a mysql console with succes. If the result of the query is very big (but I don't know exactly the limit), I get the message : Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource ... I think that there is a problem in the function mysql_query. Who knows how to avoid it ?
View Replies !
Buffer Overflow
i am using the abyss webserver at the moment. i went through the process of how a buffer overflow would work in my mind. i noticed you can limit the size of post data and its limit value is displayed on the phpinfo page 8mb. will the post ever be so big that it causes the abyss webserver to have a buffer overflow? if not, why would you check for length of php input data? i am trying to review my code for security issues. i found some good articles. i learned to htmlentities($mydata) before displaying it and other stuff. i dont feel comfortable about implementing something if i dont have at least some idea of how it works.
View Replies !
Mysql_insert_id(); , Will It OverFlow ?
i am inserting records in a table with an AUTO_INCREMENT, field type BIGINT, as a primary key. (database: MySql) i want to ask that mysql_insert_id(); returns the integer type value.. will it cause Overflow error ?
View Replies !
Preventing DIV/text Overflow By Ending Div
I have created a DIV that contains a text variable. Looks something like this: <div><?php echo($text);?></div> One very important thing to point out is that the div is styled using CSS, and must have a specific width and height. Above works great, except for when the text is very long. Different browsers handle the text overflow differently, but regardless of how they handle it, the output is not ideal. What is preferred is if the text is split up, and put into multiple divs, like this: <div><?php echo($text[1]);?></div> <div><?php echo($text[2]);?></div> Right now I am using something along those lines. My text is exploded based on spaces between the words. Then the number of words are counted. Code:
View Replies !
PHP 5 On Solaris 5.9
All seems to have installed OK but when I add the lines to Apache as below it gives errors. LoadModule php5_module libexec/libphp5.so AddModule mod_php5.c Syntax error on line 241 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/libexec/libphp5.so into server: ld.so.1: /usr/local/apache/bin/httpd: fatal: /usr/local/apache/libexec/libphp5.so: open failed: No such file or directory /usr/local/apache/bin/apachectl start: httpd could not be started AND Syntax error on line 247 of /usr/local/apache/conf/httpd.conf: Cannot add module via name 'mod_php5.c': not in list of loaded modules /usr/local/apache/bin/apachectl start: httpd could not be started PHP seemed to install OK and I search for these modules but they cannot be found. Apache is 1.3.27
View Replies !
Solaris IDE
im kicking around the idea of purchasing a sparc workstation because: 1) they are really cheap on ebay. 2) i always wanted to give one a shot. 3) they are really cheap on ebay. Since i do php development, is there any decent IDE for php development out there that will run on sparc sunos? anyone doing development on a sparc? I'm looking at something like a dual CPU sparc 1000 (dual 750's), and im also curious as to the performance compared to a windoz pc.
View Replies !
Compiling PHP On Solaris
Not sure if this is the best place to ask this, I am trying to compile PHP 5.2 on a Solaris 9 system. I need Oracle DB support so can't use the pre compiled packages on blastwave as I don't think anyof them include Oracle. The configure script is: ../configure --prefix=/usr/local/php-5.2.0 --with-apxs2=/usr/local/apache-2.0.55/bin/apxs --with-mysql=/opt/sfw/mysql --with-pear --with-libxml-dir=/opt/csw/ --with-config-file-path=/etc/php5 --with-curl --with-dom --with-zlib --with-oci8=instantclient,/usr/local/oracle/instantclient_10_2 --with-gd --with-jpeg-dir=/usr/sfw/lib And I get the error: checking for the location of libjpeg... /usr/sfw/lib checking for the location of libpng... no checking for the location of libXpm... no checking for FreeType 1.x support... no checking for FreeType 2... no checking for T1lib support... no checking whether to enable truetype string function in GD... no checking whether to enable JIS-mapped Japanese font support in GD... no checking for fabsf... no checking for floorf... no configure: error: libjpeg.(a|so) not found. BUT [/usr/local/src/php-5.2.0]# ls /usr/sfw/lib <snip> libjpeg.so libjpeg.so.62 So why is it complaining? Does anyone know? I am puzzled why it bales out after the "checking for floorf... no" line and not straight after the libjpeg line 9 lines above. I am using gnu gcc and ld.
View Replies !
Trouble On Solaris 8
I'm installing Apache 2.2, PHP 5.04, and mySQL 4.0.21 on a Solaris 8 machine using prebuilt binaries from sunfreeware.com. My apache install went smoothly - the only thing I'm having to work around is an inability to use /usr/local - it's an NFS mount to a central image, so I'm installing in /opt/local. After installing PHP and modifying httpd.conf, I get the following error on startup: httpd: Syntax error on line 110 of /opt/local/apache2/conf/httpd.conf: API module structure `php5_module' in file /opt/local/apache2/modules/libphp5.so is garbled - perhaps this is not an Apache module DSO? Now, I have to confess that I don't have mysql installed yet, but I would think that simply loading the php module wouldn't require this, would it? A search for this message shows one other user has seen it recently, but no resolution online. No hint in /var/apache/logs - no mention of php at all in any of the logs. Any clues as to what could be causing this?
View Replies !
PHP Slow On Solaris
Does anybody knows why php runs so damm slow on solaris. PHP works fine, but if you use the array function it get really slow. everyone could try it on different platforms. fill a array with 100.000 elements in a loop and you will see what i mean. debugger output shows that php ist trying to get memory for each element. --> anybody know how to tune this in solaris or php? Code:
View Replies !
With Java On Solaris
This is my system configuration OS Sun Solaris SPARC 8 Apache version 1.3.26(Unix) PHP version php-4.1.0 java version j2sdk1.4.2_14 for soalris i am trying to build php with java support but when i try to configure it with follwing command: ./configure --with-apxs=/usr/apache/bin.paxs --with-java=/usr/j2se --with-config-file-path=/etc --with-openssl=/usr/local/ssl then make and then make install everything goes well without any error. but at the end i dont find any php.ini file in /etc and if i copy it from the distribution of php and edit the file with java class path and library path tha php page using java class doesnt work. can anybody provide me detailed step on how to do java integration in php on solaris.
View Replies !
Installing PHP 5.2.1 On Solaris
I've been following the install guide on the PHP website and everything has gone fine up until where I'm stuck now. I've got Apache installed and running, and I've ran ./configure in the PHP directory with the necessary flags. However, the next step in the process listed in the guide is to do a make. BUt when I do that, this is what I get: Code: make: *** No targets specified and no makefile found. Stop. There's nothing in the install guide that says I have to specify a makefile, and it isn't covered in the FAQ either.
View Replies !
SPARC And Solaris 10
I'm being moved from a windows platform to a Unix platform due to some corporate restructuring. I've been coding .asp pages and was about to move from .asp to .php on windows. Can you tell me: i know that PHP runs on the platform SPARC and Solaris 10, but does it require Apache or can it run on the native Solaris web server?
View Replies !
'rsh' To Solaris 8
When I ran remote shell to a Sun Solaris 8 box from W2K box, the DOS' CMD window popped up and stayed there until CGI timeout. I had to kill the window by clicking on 'x'. After that it displayed CGI timeout error. What was going on? PHP script on Windows 2K: <? php /* Call a script on a remote unix box to display the name */ system <"rsh remoteunix -l thisuser "/mybin/test.sh $firstName $lastName"">; ?> Shell script on Unix box: #!/bin/sh firstName=$1 lastName=$2 echo Your name is: $firstName $lastName exit 0
View Replies !
This Script Is Just A Wrapper For Php (solaris!)
Hi there. Had a look around google and found one post from someone with almost the same error and no reply. SunOS webdb 5.8 I have been trying to install PHP to work with Apache and it all works fine apart from trying to run php from bash. ../configure --with-sybase=/usr/local/freetds --with-tdsver=7.0 --with-apxs=/ usr/apache/bin/apxs --with-mysql=/opt/sfw/mysql --enable-sockets All fine... /opt/sfw/bin/gmake install # echo $LD_RUN_PATH /usr/local/ssl/lib:/opt/sfw/mysql/lib/mysql This all works fine with PHP and Apache but when trying from bash I get the error.. # /usr/local/bin/php /usr/local/bin/php: error: /usr/local/bin/.libs/php does not exist This script is just a wrapper for php. See the libtool documentation for more information. I tried a few more things without success and even tried creating `.libs` incase it was a permission problem when it was compiling - still zilch.
View Replies !
Compiling Php 4.3.4 On Solaris 8 Mysql
Exact output is: ld: fatal: file /opt/sfw/mysql/lib/mysql/.libs/libmysqlclient.so: open failed: No such file or directory ld: fatal: File processing errors. No output written to ..libs/libphp4.so Again, why is it lokking for the MySQL client library in ".libs" ?
View Replies !
PHP N Apache Installation On Solaris
Can anyone guide me how to install and configure PHP with Apache on Sun's Solaris 2.7 The details of my Solaris are as follows... Sun Ultra 5/10 System v Release 4.0 Solaris 2.7 SunOS Release 5.7 Generic_106541_06
View Replies !
Connecting To Sql Server From Php (solaris)
I have be assigned to find a way to connect to a SQL server from PHP installed on Solaris 9. It would be very helpfull if someone could guide me on this or give me any useful links. I have read about connecting to sql server from PHP (unix) - will the same work for Solaris version.
View Replies !
Installation Problem (Solaris 8)
i want to compiled PHP 4.3.3 under Solaris 8. My Configuration: Solaris Version 5.8 gcc Version 3.2 PHP 4.3.3 The compile prozess stopped by the compiling the "dns.c" Volker Here is my error log: make /bin/sh /export/home/vpn/src/phprojekt/php-4.3.3/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/standard/ -I/export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/ -DPHP_ATOM_INC -I/export/home/vpn/src/phprojekt/php-4.3.3/include -I/export/home/vpn/src/phprojekt/php-4.3.3/main -I/export/home/vpn/src/phprojekt/php-4.3.3 -I/export/home/vpn/src/phprojekt/php-4.3.3/Zend -I/export/home/vpn/src/phprojekt/mysql-standard-4.0.14-sun-solaris2.8-sparc/ include -I/export/home/vpn/src/phprojekt/php-4.3.3/ext/xml/expat -D_POSIX_PTHREAD_SEMANTICS -I/export/home/vpn/src/phprojekt/php-4.3.3/TSRM -g -O2 -prefer-pic -c /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c -o ext/standard/dns.lo /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c: In function `zif_gethostbynamel': /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:186: warning: passing arg 2 of `add_next_index_string' makes pointer from integer without a cast /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c: In function `php_gethostbyname': /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:206: warning: passing arg 1 of `_estrdup' makes pointer from integer without a cast /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c: In function `zif_checkdnsrr': /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:228: `T_MX' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:228: (Each undeclared identifier is reported only once /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:228: for each function it appears in.) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:239: `T_A' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:240: `T_NS' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:242: `T_PTR' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:243: `T_ANY' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:244: `T_SOA' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:245: `T_CNAME' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:256: `C_IN' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c: In function `zif_getmxrr': /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:288: `HEADER' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:288: `hp' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:317: `C_IN' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:317: `T_MX' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:324: parse error before ')' token make: *** [ext/standard/dns.lo] Error 1
View Replies !
Problems Compiling PHP 4.3 On Solaris 8
I'm having trouble compiling PHP 4.3.4 on Solaris 8. This is the error message it is showing: -- start -- Undefined first referenced symbol in file php_parse_date ext/standard/datetime.o ld: fatal: Symbol referencing errors. No output written to sapi/cli/php collect2: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for target `sapi/cli/php' -- end -- The most common suggestiong I found while searching google was to upgrade GCC from 2.95 to the latest. I upgraded both the GCC and the libgcc packages and the error still continues. I also tried rolling back to an earlier version (4.3.3) unsuccessfully.
View Replies !
Install Problem Of 5.2.4 On Solaris 8
when I try to ./configure ... I get error about xml2-config is to old, and its pointing to a /usr/local/bin. but I have libxml2 and xml2-config install in /opt/csw/bin So how do I tell php ./configure to use the xml2-config thats in /opt/csw/bin?
View Replies !
Adding Negative Numbers On Solaris
I get an unexpected result when I add two negative numbers in PHP on SPARC/Solaris 8. The same program works fine on Intel/Linux. I'm using PHP 4.3.1 on both systems. Here is my program, test.php. <?php $a = 0x81234567; $b = 0xF0000002; printx($a, $b); printx($a, intval($b)); printx(intval($a), $b); printx(intval($a), intval($b)); function printx($a, $b) { $c = $a + $b; printf("%08X (%u) %7s + %7s = %7s ", $c, $c, gettype($a), gettype($b), gettype($c)); } ?> I run it from the shell prompt like this: php -f test.php Output on Intel/Linux, PHP 4.3.1 71234569 (1898136937) double + double = double 71234569 (1898136937) double + integer = double 71234569 (1898136937) integer + double = double 71234569 (1898136937) integer + integer = double This is the answer that I expect. I am adding two 32-bit integers, and the value overflows. Here is what happens when I run it on SPARC/Solaris 8, PHP 4.3.1 FFFFFFFF (4294967295) double + double = double 71234569 (1898136937) double + integer = double 71234569 (1898136937) integer + double = double 80000000 (2147483648) integer + integer = double When both arguments are negative doubles or both are negative integers, then it gives the wrong answer. What is causing this, and how do I avoid this strange behavior?
View Replies !
Can't Build Apache/PHP/MSSQL On Solaris
Having read everything I can, and compiled apache/php 30/40 times, I cannot seem to get a static version of PHP working with FreeTDS. I know the FreeTDS drivers for MSSQL are working, cos it took minutes to install the Perl Drivers. However, the PHP drivers just will not work ! The BBs/Forums all seem to complain about exactly the same problem, and the only success stories are for Linux. Is this because PHP isn't supported as well as Perl ? Has anyone out there got PHP running on Sparc to talk to an MSSQL server ?
View Replies !
PHP 5.0.1, Solaris 5.9, Sablotron 1.0.2, Config Problems
Can run sabcmd with no problems. But when running a simple php script, it cannot find the sablotron functions. So it does not appear to be linking the Sablotron stuff. Probably just something simple I am missing. Built with: configure --with-xml --with-expat=/usr/local --enable-xslt --with-xslt-sablot=/usr/local Simple PHP script: <?php $parser = xslt_create(); $html= xslt_process($parser, "test.xml", "test.xsl"); xslt_free($parser); echo $html; ?> Returns: Fatal error: Call to undefined function xslt_create() in /tmp/xsl.php on line 2
View Replies !
Xampp For Solaris X86, Need Zipped File
trying to get xampp....0.8.1.sh for solaris 9 x86. I only have access to the web via a windows box to download the .sh file. Windows corrupts the file so can not get it to the unix box tied up behind a firewall. Can anyone do a gzipped version of the xampp file for me?
View Replies !
Installing Php With Curl On Solaris 8 Problem
I want to install php (4.1.2 4.2.1 4.3.1 whatever) on solaris 8 i gave up instaling curl 7.9 so i managed to install curl 7.8.1 from sunfreeware and then tried to install php ,i had to install a couple of packages like gd ,gdbm and etc and then i could pass the configure phase! but during make i got this error: curl.c: In function `zm_startup_curl`: curl.c:176: `CURLPOT_COOKIRJAR` undeclared (first use in this function) <and a few similar errors> on google i found a posting which said my curl version is low but i already have this version of curl and php running on linux ....any idea?
View Replies !
Decimal Parts On Solaris (PHP+ZendOptimizer)
I have problem with decimal parts on Solaris (PHP+ZendOptimizer). When I get value from MySQL (or from text file - I have had the same), it is loosing decimal parts. For example, let say, that from MySQL I have $line[myvalue]=123.45 Then if I will do this: Code:
View Replies !
SunONE 6.1 / 4.3.8 / Solaris 8 -> _db_return_ Errors In Log Files
we have a server which has lots of errors of this type: [09/Nov/2004:15:19:21] info (25982): CORE3261: Crash occurred in NSAPI SAF php4_execute [09/Nov/2004:15:19:21] info (25982): CORE3262: Crash occurred in function _db_return_ from module /sunone/bin/libphp4.so [09/Nov/2004:15:19:21] failure ( 1091): CORE3107: Child process closed admin channel We are running SunONE 6.1 (formely iPlanet) on a Solaris 8 server with PHP 4.3.8 (but this problem was appearing from 4.3.3). We can't seem to find a pattern to make these lines appear in the logs..
View Replies !
Solaris 9: Can't Build Libjpeg Shared Object
I realize this is the php group, but I have a question that recurses back to my php install. My objective is a pure 64 bit shared object installation of php 5.0 on UltraSparc Solaris 9 compiled with the Sun Compiler version 8. My problem is that EVERYTHING builds great EXCEPT that the 6b distribution of JPEG will NOT build a shared object, thus gd cannot include support for JPEG, thus php loses that functionality. ** Configuration summary for gd 2.0.28: Support for PNG library: yes Support for JPEG library: no Support for Freetype 2.x library: yes Support for Xpm library: yes Support for pthreads: yes Yes, I've seen the install.doc from jpeg-6b: "* If you want to build libjpeg as a shared library, say ./configure --enable-shared" Here's that output: 1 [gis 9] ~/jpeg-6b > ./configure --enable-shared 2 checking for gcc... /opt/SUNWspro/bin/cc 3 checking whether the C compiler (/opt/SUNWspro/bin/cc -fast -xarch=v9a -xO5 ) works... yes 4 checking whether the C compiler (/opt/SUNWspro/bin/cc -fast -xarch=v9a -xO5 ) is a cross-compiler... no 5 checking whether we are using GNU C... no 6 checking how to run the C preprocessor... /opt/SUNWspro/bin/cc -E 7 checking for function prototypes... yes 8 checking for stddef.h... yes 9 checking for stdlib.h... yes 10 checking for string.h... yes 11 checking for size_t... yes 12 checking for type unsigned char... yes 13 checking for type unsigned short... yes 14 checking for type void... yes 15 checking for working const... yes 16 checking for inline... inline 17 checking for broken incomplete types... ok 18 checking for short external names... ok 19 checking to see if char is signed... yes 20 checking to see if right shift is signed... yes 21 checking to see if fopen accepts b spec... yes 22 checking for a BSD compatible install... /usr/local/bin/install -c 23 checking for ranlib... ranlib 24 LTSHARED is yes 25 ------------> I am using libtool in /usr/local/bin/libtool 26 checking host system type... sparc-sun-solaris2.9 27 checking for ranlib... ranlib 28 checking whether we are using GNU C... no 29 checking for /opt/SUNWspro/bin/cc option to produce PIC... -KPIC 30 checking if /opt/SUNWspro/bin/cc PIC flag -KPIC works... no 31 checking if /opt/SUNWspro/bin/cc static flag -Bstatic works... none 32 checking whether ln -s works... yes 33 checking for non-GNU ld... /usr/ccs/bin/ld 34 checking if the linker (/usr/ccs/bin/ld) is GNU ld... no 35 checking whether the linker (/usr/ccs/bin/ld) supports shared libraries... yes 36 checking for BSD-compatible nm... /usr/ccs/bin/nm -p 37 checking command to parse /usr/ccs/bin/nm -p output... yes 38 checking how to hardcode library paths into programs... immediate 39 checking for /usr/ccs/bin/ld option to reload object files... -r 40 checking dynamic linker characteristics... solaris2.9 ld.so 41 checking if libtool supports shared libraries... no 42 checking whether to build shared libraries... no 43 checking whether to build static libraries... yes 44 checking for objdir... .libs 45 creating libtool 46 checking libjpeg version number... 62 47 creating ./config.status 48 creating Makefile 49 creating jconfig.h 50 jconfig.h is unchanged 51 [03:35 - 0.21] As you can see from line 41 above, configure is convinced libtool cannot support shared libraries. I modified the configure script to output the location of the libtool being used (line 25) and the value of LTSHARED (line 24). Has ANYONE out there successfully milked out a shared object from the 6b distribution of libjpeg ?? This is the only thing holding up my build.
View Replies !
Solaris/Apache, Child Pid 3383 Exit Signal Segmentation
I cant get php to work on soalaris 8 when I start apache: [Mon Mar 8 11:39:59 2004] [notice] Apache/1.3.27 (Unix) PHP/4.3.2 configured -- resuming normal operations but when I got to my test.php page: which is <?php phpinfo(); ?> Then I get a page cannot be displayed page. then in the apache error logs: Mon Mar 8 11:40:32 2004] [notice] child pid 3383 exit signal Segmentation Fault (11) [Mon Mar 8 11:40:32 2004] [notice] child pid 3382 exit signal Segmentation Fault (11) [Mon Mar 8 11:41:31 2004] [notice] child pid 3384 exit signal Segmentation Fault (11) What do I need to do? I installed the SFWmphp package from soalris 9 which I installed on solaris 8.
View Replies !
Really Big Integer
I need to calculate the sum of the following numbers 1+ 11 + 111 + 1111 + ......+ 1111.....11111 (the last one is a number made by 2002 1's ) so, I wrote $res =0; for ($i = 1; $i<2003; $i++){ echo str_repeat("1", $i).'<br>' $res += str_repeat("1", $i); } echo 'El resultado total es:<br>' echo $res; All works pretty well, and after a really small piece of time, I get: 1.2345679012346E+308 but the result seems to be wrong, beacause I do know (given that I have a math proof), that it should have 224 1's inside, and as fas as I know, 1.2345679012346E+308 means 1.2345679012346 * 10^308 which obviously doesn't have such amount of 1's (in fact only has 2 ) Can anyone point me where is the mistake?
View Replies !
Integer URL
I once found a PHP script that converted an IP address to an integer. Does anyone know where that script is?
View Replies !
Integer Format
I have some mysql field like qua integer (7). How can I display this field in screen like this 50,000.- ? I try to use printf($qua,"%5d) but it don't work... Thank
View Replies !
How Can I Get INTeger From Float
If I have a number that includes decimal points and I want to remove everything right of the decimal, how do I do it - I know I could explode using the point as a delimiter but that doesn't look legal. I've tried $t=1.532; $y=int($t); but that didn't work out for me...
View Replies !
Zero Filling Integer
Is there a way in PHP to zero fill an integer to a specified length? For instance, if I have a two digit number, and I want to zero fill it to four digits, is there a PHP function I can use? Or do I manually have to add zeros to the front?
View Replies !
Adding A Zero To An Integer
I'm trying to work out how to format a variable as two digits even if it's one...so: 1 becomes 01, 2 becomes 02, but 10 stays as 10... is there an easy way? i tried number_format but that seems to only be for float vars.
View Replies !
Length Of Integer
Basically i have a number: $i = 1 i want to keep adding to that number in a loop but i want it to give me: 01 02 03 04 ... rather than 1 2 3 4 how can i do this? If i make $i=01 i then get: 01 2 3 4
View Replies !
Get Part Of A Integer
just like you have substr() to get part of a string, is there a way to get part of an integer? $myVar = 20060103142005; // and want $myVar = 20060103; what's the best way to do it? $myVar = 20060103142005; $myVar = substr ($myVar, 0, 8); echo $myVar; doesn't work. Trying to convert the number to a string doesn't work either: Code:
View Replies !
Compare The Integer
i hav a problem here. <?php $answer = datediff("1984-05-02","now","y"); if($answer > 5){ echo "half year"; }else{ echo "not yet"; } ?> datediff() actually is a function that will print the age. so the age is 23. but for if else statement, 23 > 5 will print "not yet"...it should print "half year" rite? but,when i change to if($answer = 23), it will print "half year".
View Replies !
Integer Manipulation
I'm wondering if any of you know any code that would convert a number that was entered with commas e.g. 1,000 to a calculation friendly number: 1000
View Replies !
Echoing The Integer 0
Probably it's something dumb that I'm doing/not doing, but echo doesn't seem to want to echo a literal zero when the value of some var is zero. E.g.: $foo = 0 ; echo 'foo is ' . $foo ; yields: foo is not foo is 0 So far I've been kludging it with $foo?$foo:Ɔ', but I find it strange to have to do that, not to mention annoying. Is it something I'm doing, or is that a real deficiency in the language?
View Replies !
Integer Problem
I am trying to query a game server and get the information I need using fread() into a buffer. I then parse this information, extracting server name, map name etc. etc. but when I come to the number of players, I have no idea how to recognize this as a number. $numplayers = $data[14]; echo sprintf("Num Players %d" , $numbers); displays 0 echo sprintf("Num Players %d" , $data[14]); displays 0 echo sprintf("Num Players %s" , bin2hex($data[14])); displays 0a (10, so the value at [14] is actually there, but how do I get it to be recognized as an int so my code can then work based on the $numplayers.
View Replies !
Randomization By Integer
I have a table with a value: Popularity. What I want to do is do a site randomization. I have rows: id, url, website_description, popularity What I want to do is do a randomization where a site will come up in the script by a popularity number of 1 to 100(or more). My problem is I have seen plenty of randomization scripts out there but nothing this complex. Wondering if someone knows a way to do this. I want it to randomize all sites but those sites that have the highest popularity rating would show up more then the sites with the lowest.
View Replies !
Integer Vs Decimal
I'm working on a voting script for entries. I record the rating (big int adding on everytime someone votes) and the number of votes. To output the data, I will use 0-5 stars. Basically, take rating, divide by number of votes, and decide which image to use. Decimals.
View Replies !
|