Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-21-2007, 09:43 PM
|
#1
|
|
LQ Newbie
Registered: Mar 2005
Location: Toronto, Canada
Distribution: debian
Posts: 27
Rep:
|
php5 - problems after upgrade
hi folks. i've recently upgraded my php from 4 to 5 and its acting very strangely.
i've been following a book (Beginning php apache mysql web development) and some of my scripts are still working but when i try anything that involves mysql, i get a blank page. no errors, just blank, and 'display_errors' is turned on in php.ini. phpinfo() also gives the same result. i'm using suse 10.0 with apache 2.0.54 and mysql 4.1.13. i've used apt/synaptic to upgrade php and i selected everything available so i don't think i could be missing anything. if anyone is familliar with this book, i'm on the 'moviesite' section and the earlier files which only access other php files are working fine, its when i try the stuff that creates the database and populates it that apparently nothing happens. the same phpinfo() file which worked fine with php4 now comes up blank as well. i've gone through my apache config files and can't see anything wrong. any ideas?
|
|
|
|
01-22-2007, 01:52 AM
|
#2
|
|
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,276
Rep:
|
take another look at php.ini whether you find this
error_reporting(E_ALL ^ E_NOTICE);
if there is sth like
error_reporting(0);
it would be an explanation for the blank page. But I'm just guessing...
Good luck,
j
|
|
|
|
01-22-2007, 06:49 AM
|
#3
|
|
LQ Newbie
Registered: Mar 2005
Location: Toronto, Canada
Distribution: debian
Posts: 27
Original Poster
Rep:
|
on my system it looks like: error_reporting = E_ALL & ~E_NOTICE. everything looks right as far as i can tell. i'm wondering if something extra has to be done to enable a certain module. i have both php5-mysql and php5-mysqli packages installed. can you have both or does it have to be one or the other?
|
|
|
|
01-22-2007, 06:09 PM
|
#4
|
|
LQ Newbie
Registered: Mar 2005
Location: Toronto, Canada
Distribution: debian
Posts: 27
Original Poster
Rep:
|
found the answer! in the files i used to create and populate the database, i just copied and pasted code from the book in pdf. for some reason, any double-quotes were not recognized properly. once i manually re-typed all the double-quotes, everything works.
|
|
|
|
01-22-2007, 08:42 PM
|
#5
|
|
LQ Newbie
Registered: Mar 2005
Location: Toronto, Canada
Distribution: debian
Posts: 27
Original Poster
Rep:
|
not resolved!
ok, i spoke too soon. a simple connect script worked:
PHP Code:
<?php $connect = mysql_connect("localhost", "root", "*****") or die (mysql_error()); echo "connection successful"; ?>
so i got excited but after i manually typed all this, i got no 'Movie Database successfully created', no errors, nothing. browser says 'page loaded' but its blank:
PHP Code:
<?php //connect to mysql $connect = mysql_connect("localhost", "root", "*****") or die (mysql_error());
//create main database mysql_create_db("wiley") or die (mysql_error());
//select database mysql_select_db("wiley");
//create "movie" table $movie = "CREATE TABLE movie ( movie_id int(11) NOT NULL auto_increment, movie_name varchar(255) NOT NULL, movie_type tinyint(2) NOT NULL default 0, movie_year int(4) NOT NULL default 0, movie_leadactor int(11) NOT NULL default 0, movie_director int(11) NOT NULL default 0, PRIMARY KEY (movie_id), KEY movie_type (movie_type, movie_year) ) TYPE=MyISAM AUTO_INCREMENT=4";
$results = mysql_query($movie) or die (mysql_error());
//create "movietype" table $movietype = "CREATE TABLE movietype ( movietype_id int(11) NOT NULL auto_increment, movietype_label varchar(100) NOT NULL, PRIMARY KEY (movietype_id) ) TYPE-MyISAM AUTO_INCREMENT=9";
$results = mysql_query($movietype) or die (mysql_error());
//create "people" table $people = "CREATE TABLE people ( people_id int(11) NOT NULL auto_increment, people_fullname varchar(255) NOT NULL, people_isactor tinyint(1) NOT NULL default 0, people_isdirector tinyint(1) NOT NULL default 0, PRIMARY KEY (people_id) ) TYPE=MyISAM AUTO_INCREMENT=7";
$results = mysql_query($people) or die (mysql_error());
echo "Movie Database successfully created!"; ?>
checking with mysql via terminal shows that no new database was created. i'm lost.
Last edited by rickbot; 01-22-2007 at 08:44 PM.
|
|
|
|
01-23-2007, 09:09 PM
|
#6
|
|
LQ Newbie
Registered: Mar 2005
Location: Toronto, Canada
Distribution: debian
Posts: 27
Original Poster
Rep:
|
got it this time! turns out there are two different 'php.ini' files. all this time i've been looking at /etc/php.ini and then i discovered /etc/php5/apache2/php.ini. i edited the latter to turn error_reporting = On and got:
Code:
Fatal error: Call to undefined function mysql_create_db() in /home/rickbot/public_html/htdocs/moviesite/createmovie.php on line 8
the problem is that 'mysql_create_db()' is no longer supported in php5. i changed:
PHP Code:
mysql_create_db("wiley") or
die (mysql_error());
to:
PHP Code:
mysql_query("CREATE DATABASE IF NOT EXISTS wiley")
or die (mysql_error());
and problem solved! thanks guys.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:14 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|