开发者

php on windows without WAMP/XAMPP...is this a fools folly?

开发者 https://www.devze.com 2023-02-05 02:00 出处:网络
I installed PHP and MySql separately, configured IIS and php.ini, after much research I got a working system.I now want to get moving and need an ORM, unit test framework, etc and find that this shoul

I installed PHP and MySql separately, configured IIS and php.ini, after much research I got a working system. I now want to get moving and need an ORM, unit test framework, etc and find that this should all be available via PEAR and that PEAR is already installed with every PHP after 4.3 but there's no go-pear.bat on my machine. I downloaded it from pear.php.net/go-pear and got a slew of warnings and finally an error.

  1. is WAMP/XAMPP "required" to use any PHP extension?

  2. why does my PHP 5.3.4(from windows.php.net) come without PEAR when nearly every site and forum post says its should?

  3. what does this errors from go-pear.bat mean? does pear require WAMP/XAMPP as it clearly isn't expecting IIS?

    We found php.exe under c:\program files\php\php.exe, it uses an unknown SAPI. PE AR commandline tool has not been tested with i开发者_StackOverflow社区t, if you have a CLI (or CGI) php.exe available, we strongly recommand to use it.


  1. Short answer: no. Longer answer: Unless you're moderately familiar with the workings of and interrelationships between the various components, using XAMPP or WAMP make things somewhat easier.

  2. I just downloaded the VC9 version of PHP 5.3.5 from windows.php.net/download/ and it had a go-pear.bat file. Not clear why you didn't get it.

  3. Here is the code from go-pear.php that determines the SAPI of the php executable:

    exec($php_bin.' -v', $res);
    if(is_array($res)) {
        if( isset($res[0]) && strpos($res[0],"(cli)")) {
            return 'cli';
        }
        if( isset($res[0]) && strpos($res[0],"cgi")) {
            return 'cgi';
        } else {
            return 'unknown';
        }
    }
    

    Essentially \path\to\php.exe -v is not returning either "(cli)" or "cgi" in the first line of the result when it is executed. Here's what mine looks like:

    J:\>php -v
    PHP 5.2.16 (cli) (built: Dec 15 2010 18:13:29)
    Copyright (c) 1997-2010 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    
    J:\>
    

    Note first that my version is a bit older. That's only because I'm testing something for 5.2 compatibility right now. 5.3 should give something similar. Note also that php is on my PATH.

Maybe PHP is not on your path? An environment variable is not set correctly? Something is preventing go-pear.php from getting a good response from the -v option.

0

精彩评论

暂无评论...
验证码 换一张
取 消