warwick Posted February 11, 2010 Share Posted February 11, 2010 File test.php with <?php phpinfo(); ?> downloads, does not run? I had Apache 2,214 and PHP 5.3.0 working fine (including above), but just installed PHP 5.3.1. Initially Apache would not start, after a lot of headaches and web searches, I found that commenting out PHP.ini line would solve this problem: [php_MSSQL] ;extension=php_mssql.dll (Following further advice, I commented out all the extensions except extension=php_mysql.dll extension=php_mysqli.dll extension=php_openssl.dll) Apache now appears to be working, most of my HTML files and PHP code appear to work, with the exception of a simple PHP script to test PHP, PHPinfo(). When I attempt to run this, (using Google Chrome), it downloads the php file, rather than running it? The PHP file simply contains one line: <?php phpinfo(); ?> Why does this file now download rather than giving me my system PHP information Quote Link to comment https://forums.phpfreaks.com/topic/191800-php-531-apache-2214-phpinfo-not-working/ Share on other sites More sharing options...
jskywalker Posted February 11, 2010 Share Posted February 11, 2010 you did try to see it using: "http://localhost/test.php" , and not via "c:\test.php" ???? Quote Link to comment https://forums.phpfreaks.com/topic/191800-php-531-apache-2214-phpinfo-not-working/#findComment-1010894 Share on other sites More sharing options...
warwick Posted February 11, 2010 Author Share Posted February 11, 2010 Yes, http://testsite.co.nz.local/test.php My other PHP scripts in the same directory work fine in my browser (Google Chrome) Quote Link to comment https://forums.phpfreaks.com/topic/191800-php-531-apache-2214-phpinfo-not-working/#findComment-1010903 Share on other sites More sharing options...
PFMaBiSmAd Posted February 11, 2010 Share Posted February 11, 2010 just installed PHP 5.3.1. How exactly did you install it and how did you remove the previous version? Is the file with the phpinfo() statement in a folder where your other .php files work at? Quote Link to comment https://forums.phpfreaks.com/topic/191800-php-531-apache-2214-phpinfo-not-working/#findComment-1010910 Share on other sites More sharing options...
warwick Posted February 11, 2010 Author Share Posted February 11, 2010 I believe I have overcome this, but dont really know what problem was. It is strange (at least to me who is just a month into my personal PHP journey). It is something to do with this specific file. If I use phpinfo() within another script it works fine. I have created a new file test2.php with the same text <?php phpinfo(); ?> and this works. I have even shut down PC and tried test.php again, but it still downloads. It appears to be something to do with caching of the test.php file. I even deleted test.php and then renamed test1.php to test.php, but this still downloaded. I think I will just delete this file and move on. However, if someone has the answer as to why a php file would download, rather than opening (or how to investigate the reason), I would be interested. FYI, PHP 3.5.0 was removed using Windows add/remove program. (I uninstalled PHP 3.5.0 as it was installed without PEAR options, which I wanted to try). I no longer had the 3.5.0 installer , so downloaded 3.5.1 (php-5.3.1-Win32-VC6-x86.msi on my XP machine). After rebooting I installed 3.5.1 with the msi installer (and also selected the optional PEAR installation). Most likely related is that when I tried running go-pear.bat from the php directory I get the Windows command line screen error.. phar "C:\Program Files\PHP\PEAR\go-pear.phar" does not have a signaturePress any key to continue . . . I still have this problem to resolve. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/191800-php-531-apache-2214-phpinfo-not-working/#findComment-1010983 Share on other sites More sharing options...
wildteen88 Posted February 11, 2010 Share Posted February 11, 2010 It may be your browsers cache causing the download. Try clearing your browsers cache and try test.php again. For some reason go-pear.bat does not work properly only Windows. For a work a round open a command line and cd to your PHP installation folder, eg cd C:/Program Files/PHP Now run the following command php.exe -d phar.require_hash=0 go-pear.phar You should be able to setup pear now Quote Link to comment https://forums.phpfreaks.com/topic/191800-php-531-apache-2214-phpinfo-not-working/#findComment-1011035 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.