• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 780
  • Last Modified:

get bit version for PHP on Windows 7/Vista

Hi,

I'm trying to determine the bit (32 or 64 bit) version of the PHP that I installed (WAMP) on my Windows 7 (it's a 64-bit).

When I run, phpinfo() I see this:
Compiler  MSVC9 (Visual C++ 2008)  
Architecture  x64  
Configure Command  cscript /nologo configure.js "--enable-snapshot-build" "--with-pdo-oci=C:\php-sdk\php53dev\vc9\x64\deps\instantclient_10_2\sdk,shared" "--with-oci8=C:\php-sdk\php53dev\vc9\x64\deps\instantclient_10_2\sdk,shared" "--with-oci8-11g=C:\php-sdk\php53dev\vc9\x64\deps\instantclient_11_2\sdk,shared" "--disable-debug-pack" "--disable-static-analyze"  

But I read that one can determine the PHP bit version by running this:
?php switch(PHP_INT_SIZE) {    
    case 4:
        echo '32-bit version of PHP<br />';
        echo 'PHP_INT_SIZE is ' . PHP_INT_SIZE;
        break;
    case 8:     
        echo '64-bit version of PHP<br />';
        echo 'PHP_INT_SIZE is ' . PHP_INT_SIZE;
        break;
    default:      
        echo 'PHP_INT_SIZE is ' . PHP_INT_SIZE;
        break;
}
?>

Open in new window


But with this I get:
32-bit version of PHP
PHP_INT_SIZE is 4

Why the difference?

BTW, I tried to look for the PHP constants and their definitions on the php.net site but it's pretty sparse on the descriptions.
http://php.net/manual/en/reserved.constants.php

Anyone know of another site that gives better descriptions, like return values and what the values mean and examples?

Thank you,
Victor
0
Victor Kimura
Asked:
Victor Kimura
  • 3
  • 2
2 Solutions
 
jrm213jrm213Commented:
My guess would be you installed the 32bit version of php  on the 64bit hardware. Did you compile from source? Where did you get your php install or source files from?
0
 
Victor KimuraSEO, Web DeveloperAuthor Commented:
I got it from sourceforge I believe. I didn't compile.

I think the sourceforge is 32bit, isn't it?

0
 
jrm213jrm213Commented:
It really depends. You could try something like this: http://www.wampserver.com/en/ if you click download there is a link for both 32bit and 64bit.

0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Victor KimuraSEO, Web DeveloperAuthor Commented:
I had to uninstall the 32bit. It wasn't working. So I tried to reinstall the 64bit and now that's not working. I downloaded just now from wampserver.com. It's the same file I believe though (for the 32bit).

Would i need to reboot with the virtualbox. I'm just installing it now?

I'm wondering if there is a simple way to just set up AMP (32bit).
0
 
Victor KimuraSEO, Web DeveloperAuthor Commented:
I found out the the php version that was installed (wamp) is 64bit. But I still don't know why this code:

?php switch(PHP_INT_SIZE) {    
    case 4:
        echo '32-bit version of PHP<br />';
        echo 'PHP_INT_SIZE is ' . PHP_INT_SIZE;
        break;
    case 8:     
        echo '64-bit version of PHP<br />';
        echo 'PHP_INT_SIZE is ' . PHP_INT_SIZE;
        break;
    default:      
        echo 'PHP_INT_SIZE is ' . PHP_INT_SIZE;
        break;
}
?>

Open in new window


is stating 32bit. I'm thinking the case statement is wrong. i.e. case 4 doesn't mean 32bit.

1) But then what are the return values and what do they mean for PHP_INI_SIZE?

The php.net site:
http://php.net/manual/en/reserved.constants.php

2) isn't very descriptive. Is there a site for better descriptions on the PHP constants?
0
 
Ray PaseurCommented:
See http://www.laprbass.com/RAY_temp_vkimura2007.php

Output on my server:
PHP_INT_SIZE: 8
PHP_INT_MAX: 9,223,372,036,854,775,808

Regarding this: Is there a site for better descriptions on the PHP constants? Yeah, I would love to find it, if it exists!
<?php // RAY_temp_vkimura2007.php
error_reporting(E_ALL);
echo "<pre>";

echo PHP_EOL;
echo "PHP_INT_SIZE: ";
print_r(PHP_INT_SIZE);

echo PHP_EOL;
echo "PHP_INT_MAX: ";
print_r(number_format(PHP_INT_MAX));

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now