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
Victor KimuraSEO, Web DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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?
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?

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

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).
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?
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

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.