0

I'm finally biting the bullet and upgrading my PHP/MySQL installations to version 5 (I've had too many dependencies on Apache 1.3, sites using MySQL 4.x and PHP 4.x, and a bunch of other problems). It's sort of working, but only if I explicitly specify <?php xxx ?> but not if they don't, i.e., <? xxx ?>.

For example, the typical script to test if your PHP and Apache installations are working together is:

 <? phpinfo(); ?> 

This does not run. But if I change it to this:

 <?php phpinfo(); ?> 

...then it runs just fine, which shows that both Apache and PHP are properly installed. MySQL is working, too, but I want to manage it with phpMyAdmin, but all the PHP scripts in it use <? instead of <?php, so it won't do anything.

For what it's worth, I've got these lines in my Apache httpd.conf:

 AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps 

...which I would expect to take care of the problem (i.e., running all files with the php extension through the PHP module's processor).

Any ideas?

Or do I really have to search and replace everything to explicitly specify php in these scripts (including ones I didn't write)? I'm running on Windows (WinXP SP3), if that makes any difference in the answer.

EDIT:

OK, I was wrong about phpMyAdmin using the short tag. Setting short_open_tag = On does not fix the problem. However, making this change does cause other pages to load that didn't before. I'll rewrite the code to use the long tag, since the short tag is deprecated, but I'm still trying to figure out why phpMyAdmin isn't working.

2 Answers 2

4

Check whether short_open_tag is set to 1 in your php.ini. It should be.

phpinfo should tell you the path of the file. Apache (mod_php actually) may use its own, so it doesn't hurt to check.

http://php.net/manual/en/ini.core.php

3
  • The was partly it -- it fixes the other files, but it hasn't fixed phpMyAdmin. I'll accept this as the answer to my question, since it is exactly the right answer for the question I asked, even though it doesn't fix my ultimate problem, which I obviously misidentified. Commented Apr 30, 2011 at 0:17
  • What happens exactly with phpMyAdmin - does it show you the code or does it come back blank? Is there anything in the error log in that case? Does it use any extensions apart from .php, .php5 for example? Commented Apr 30, 2011 at 0:26
  • It does nothing -- turns out it was due to the fact that I was trying to run it from an external Firewire drive. That worked with Apache 1.3, but 2.2 doesn't like it. I'd mapped a junction point from a folder on the C: drive, which allowed Apache to apparently use it, but it wouldn't run phpMyAdmin. I've moved it so it's now really on the C: drive and it works OK now. Commented Apr 30, 2011 at 1:27
0

If you do not have an error when you browse phpMyAdmin, then check the apache error logs. I think there are some php modules that are required by phpMyAdmin and that are missing or are not enabled.

1
  • Turned out it was all about running from a removable drive or not. I don't know why phpMyAdmin was pickier than Apache itself, but it was. Commented Apr 30, 2011 at 18:26

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.