Linux - SoftwareThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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?
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.
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());
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());
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.