shlomikalfa Posted May 11, 2008 Share Posted May 11, 2008 A. undefined function mysql_connect() ->> how could that be ?! and how should i fix it ?! B. how does it happen that when i open a .php file on local host i get it's content as output?! [move]Thanks a lot for the attention !!![/move] Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/ Share on other sites More sharing options...
Cory94bailly Posted May 11, 2008 Share Posted May 11, 2008 A. undefined function mysql_connect() ->> how could that be ?! and how should i fix it ?! Is that on localhost or hosting? B. how does it happen that when i open a .php file on local host i get it's content as output?! What? Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-537983 Share on other sites More sharing options...
DarkWater Posted May 11, 2008 Share Posted May 11, 2008 1) I BEG OF YOU: PLEASE READ THE STICKIED POST ON TOP OF THIS FORUM. 2) Your server must be configured improperly. Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-537984 Share on other sites More sharing options...
mlin Posted May 11, 2008 Share Posted May 11, 2008 check your php.ini to make sure the mysql and/or mysqli extensions aren't commented out if that still doesn't work. make sure that your extension_dir directive in your ini file is correct, or copy the extensions to the directory it already expects them at. After any changes to your ini file, remember to restart your apache server for the extensions to be loaded Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-537987 Share on other sites More sharing options...
shlomikalfa Posted May 11, 2008 Author Share Posted May 11, 2008 Well, i'm installing php server through WAMP5 latest version and it seems like everything was already set... P.S > i've upgraded to latest wamp version yesterday and that's what created the issue. I have uninstalled the previous version through it's uninstaller before i've upgraded! [but i haven't removed the mysql db if it has anything to do with it]. here are my efforts so far: ______________________ >> extension_dir = "c:/wamp/bin/php/php5.2.6/ext/" ;;; Checked and folder exists with a lot of .dll files. >> extension=php_mysql.dll ;;; C:\wamp\bin\php\php5.2.6\ext\php_mysql.dll exists. >> extension=php_mysqli.dll ;;; C:\wamp\bin\php\php5.2.6\ext\php_mysqli.dll exists. >> copied a file called libmysql.dll to the windows folder too ;;; DONE, c:\windows\libmysql.dll exists now. >> Looked for "php_mysql.dll" inside c:\windows\system & c:\windows\system32 & c:\windows. it's not there!!! EDIT>> COULD IT BE THAT ONLY THROUGH "ZEND" RUN function i get that error ? Cause when i open the web-page in the browser i don't get the error however i do get the source of the page as if "echo"ed out. ______________________ 2nd ISSUE: The Sticky doesn't say anything about my second issue... it seems like some of my pages are "echo"ing their source code on the page... why ? and how do i prevent it ? Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538172 Share on other sites More sharing options...
shlomikalfa Posted May 11, 2008 Author Share Posted May 11, 2008 well... the modify button has disappeared.... Current Status: A. i get the ""undefined function mysql_connect()"" from Zend Debugger only. B. i get either blank page or the source code [or a part of it] from a normal browser [no errors!] Please i need help please !!! P.S. i am reading and have read the stickies.... Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538192 Share on other sites More sharing options...
kenrbnsn Posted May 11, 2008 Share Posted May 11, 2008 For #2 ... How are you invoking your script? You have to invoke it via http://localhost/path/to/your/script, not by double clicking the file. Ken Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538200 Share on other sites More sharing options...
shlomikalfa Posted May 11, 2008 Author Share Posted May 11, 2008 i enter in my browser to: "http://localhost/Server/DEBUG.php" which should be working just fine. >> the Zend editor makes the simple file work just fine [showing it's output instead of blank page like the browser does...] but it informs me of an error specified above... ??? ??? :'( Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538204 Share on other sites More sharing options...
Btown2 Posted May 11, 2008 Share Posted May 11, 2008 Go to your php folder and grab libmysql.dll and php_mysql.dll. Move then to c:\windows\system 32 directory. if that doesnt fix the problem then post you php.ini file here. Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538205 Share on other sites More sharing options...
kenrbnsn Posted May 11, 2008 Share Posted May 11, 2008 I repeat -- for #2 how are you invoking the script? If you're double clicking it, that's wrong. Ken Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538208 Share on other sites More sharing options...
shlomikalfa Posted May 11, 2008 Author Share Posted May 11, 2008 @Btown2 tried that.. didn't help ! @kenrbnsn as i've written i do start it from the localhost path... yet same results !!! _______ Also i have noticed that the pages which shows the source code holds these lines: [which are marked by Zend as an error: "Assignment in condition"] echo "StatEcho:";while($row = mysql_fetch_assoc($ServerDetails)){//Update information.echo $row["LatestVersion"];................ and i get in the Browser: StatEcho:"; while($row = mysql_fetch_assoc($ServerDetails)) { //Update information. echo $row["LatestVersion"]; ................ As you can see the first "Echo" is oky... the rest of it is an issue... P.S >> i took these lines from the help file... Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538306 Share on other sites More sharing options...
shlomikalfa Posted May 11, 2008 Author Share Posted May 11, 2008 @Btown2 tried that.. didn't help ! @kenrbnsn as i've written i do start it from the localhost path... yet same results !!! _______ Also i have noticed that the pages which shows the source code holds these lines: [which are marked by Zend as an error: "Assignment in condition"] StatEcho:"; while($row = mysql_fetch_assoc($ServerDetails)) { //Update information. echo $row["LatestVersion"]; ................ and i get in the Browser: echo "StatEcho:";while($row = mysql_fetch_assoc($ServerDetails)){//Update information.echo $row["LatestVersion"];................ As you can see the first "Echo" is oky... the rest of it is an issue... P.S >> i took these lines from the help file... Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538319 Share on other sites More sharing options...
shlomikalfa Posted May 11, 2008 Author Share Posted May 11, 2008 no one ? please help !!! Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538399 Share on other sites More sharing options...
wildteen88 Posted May 11, 2008 Share Posted May 11, 2008 If you have WAMP installed you should not need to configure anything. WAMP sets everything up for you. If you have had a previous installation of PHP before you installed WAMP then the problem could be to do with older php binaries/extensions being left behind after your removed your older PHP setup. All php binaries/extension must be of the same version as the version of PHP you have installed. If your newer PHP installation finds older binaries/extensions then you'll experience the kind of problems you're having now. This is why your should not move any files outside of the PHP Installation folder, if you do move any files then always make sure you keep track of which files you have moved and where to. Make sure you delete those files before installing a newer version of PHP. To see if PHP is loading the mysql extension create a new file and call it info.php and place the folloiwng code in it: <?php phpinfo(); ?> Save info.php to WAMPs www folder (should be C:\wamp\www). Now go to http://localhost/info.php You should get a page displayed providing information about PHP's setup. Scroll down the page and see if you can find a mysql heading/section if you do PHP is setup correctly and so the issue is down to Zend. If you can't find a Mysql heading/section and you have enabled the PHP extension via WAMPs control panel, then I'd recommend you to do the following. Go to Start > Search and search for the following files on at a time: libmysql.dll php_mysql.dll php5ts.dll Windows should only find once instance of each of the above files (they should only be located somewhere in C:\wamp), If you find more than one of instance of the above files either rename them or delete them Now restart WAMP and run info.php. You should now find a MySQL heading/section. Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538444 Share on other sites More sharing options...
shlomikalfa Posted May 11, 2008 Author Share Posted May 11, 2008 mysql MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 5.0.51a Directive Local Value Master Value mysql.allow_persistent On On mysql.connect_timeout 60 60 mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket no value no value mysql.default_user no value no value mysql.max_links Unlimited Unlimited mysql.max_persistent Unlimited Unlimited mysql.trace_mode Off Off it appears like i have it.... however i will now uninstall and delete the entire wamp folder and try re'installing it.... i will edit/post my results.... THANKS A LOT FOR TRYING TO HELP ME !!! Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538492 Share on other sites More sharing options...
wildteen88 Posted May 11, 2008 Share Posted May 11, 2008 No dont unistall WAMP. Its not a wamp issue. It has to do with how Zend is setup. I am not experienced with Zend but I think it comes with its own PHP setup. You'll need to configure Zend to point to WAMPs PHP setup. Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538493 Share on other sites More sharing options...
shlomikalfa Posted May 11, 2008 Author Share Posted May 11, 2008 Well oky, i've found the solution to my 2nd problem... >> i had the php source code "ECHO"ed sometimes and blank pages on others... well... it looks like i've downloaded the .httpaccess file along with my other .php sources from my host and that was what making all the trouble... about zend, i will look into some zend help when i'll find the solution / if i'll find it... i will post it here. [move]!!! THANKS FOR ALL THE HELP !!![/move] Quote Link to comment https://forums.phpfreaks.com/topic/105085-solved-weird-error-undefined-function-mysql_connect/#findComment-538519 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.