Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP, MySQL apache upgrade, now nothing works

Status
Not open for further replies.

tsltsl

Technical User
Jan 17, 2002
24
SE
Hi,
I was currently running php-4.1.2, MySQL 3.23.41 and apache 1.3.27 on RedHat 7.2.
Now I have reinstalled with RedHat 8.0 which comes with php-4.2.2, MySQL 3.23.54 and httpd 2.0.40.
Before I reinstalled I exported all my DBs from MySQL.
I imported the DBs to my new installation along with the original php files for my webapplications (like phpnuke phpbb2, emform).
But now not even my simple php mailform work correct.
php seems to work without problems using phpinfo, but the old pages does not.
Is there any major difference going from php 4.1.2 to php 4.2.2 ???
Or can it be another problem besides php?

Please help
Thanks
/tsl
 
Did you install the php-mysql package as well as the PHP package? The RedHat PHP package includes MySQL functionality as an extension.

If you did, I recommend you test each subsystem individually.

You know that Apache works. You know that the core of PHP works.

Make sure that MySQL is running and working -- just try to access it from the command-line app "mysql".

Then test PHP/MySQL functionality with a simple script to perform select, update, insert, and delete operations on a test table.

This can debug the problem.

Want the best answers? Ask the best questions: TANSTAAFL!
 
Thanks,
Yes, I did installed the php-mysql package.
mysql works fine.
apache works fine.
phpmysqladmin works fine.
But I started to look at the .php pages for my applications and they did not start with <?php, only <?
I started adding <?php instead and the pages started to work better, but not all the way.
Is there any other major changes in php 4.2.2 now, so that code working on version 4.1.2 is not compatible anymore?

/tsl
 
All the issues can be fixed by going through your php.ini and editing the values to fit your needs. //Daniel
 
On an almost related note (don't want to start a new thread for this), does it really matter if you only put <? rather than <?php ?
 
It matters if you are using XML, since XML too uses the <? tag. If you aren't, then no, it doesn't matter at all. //Daniel
 
Thanks all,
I will have a look at /etc/php.ini if that might be the problem.
About <? I found out that with apache 2.x and php 4.2.2 you need to specify <?php to be able to display a php page.
After install I tried a phpinfo page with:
<? phpinfo();?>
but it just showed an empty page. I had to put
<?php phpinfo();?>
to be able to get it to work. I have verified this behaviour on several installations.
Don't know if it's apache or php requiring this?!

Because of this I was wondering if there's other code requirements on apache 2.x or php 4.2 that differs from apache 1.3 and php 4.1.2

/tsl
 
The <?php vs. <? issue is something that is determined in your php.ini file, as Daniel alluded to earlier. There a setting of something like short_tags in the ini file that you can set to allow <? ?>. I'm using it with Apache 2.0.x and PHP4.2.3.

The other thing to look out for is register_globals. Before upgrading, yo shold read up on the changes between versions. it's not all that odd for an upgrade to break something by fixing a problem or closing a hole that your code takes advantage of.

Mark --
How can you be in two places at once when you're not anywhere at all?
 
Yes, as Daniel stated it's all in php.ini
The two params that gave me all problems was:
--------------------------------------------------------
; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
short_open_tag = Off

; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = Off
--------------------------------------------------------
I changed them both to &quot;On&quot; like they where in my previous version, and everything now works as before!!

Thanks a bunch, you all
/tsl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top