Welcome Guest, Not a member yet? Register   Sign In
Install to localhost
#11

I've been trying out most, if not all, of the suggestions.  I may be getting closer to the problem, and would welcome some further thoughts.

I re-installed mysql, wampserver etc., and I was still getting no where. I uninstalled it all, and then installed Xampp (along with the variable setting info provided), and then CI. This seemed to work okay. I could display the welcome page for xampp, and ci, and I like xampp much better too.
I imported the database from the live site through phpmyadmin, and created a temporary user so I could test the connection. I then loaded the site in, and gave it a whirl. It now just sits for minutes and then fails, with no errors. So, I used a small php file to test a database connection and it fails, after quite some time, but displays an error.  If I put in an invalid connection it fails quickly, but if I use localhost:122, which is my server for this, it spins for quite some time.   I can use a url like - http://localhost:122/phpmyadmin/ or http://localhost:122/ci/ , so I thought the connection would be localhost:122 also.

Also, I enabled all of the logging, as suggested too but still nothing much shows up in the error log unless I do something wrong on purpose in some code and run it. The php_mssql.dll error is gone, but I am getting some sort of warning now "[ssl:warn] [pid 1644:tid 344] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name"

It looks like it is nothing to do with CI (or at least I'm not that far yet) and a connection problem or something related along those lines?

Code:
<?php
$link = mysql_connect('localhost:122','nairb','nairb');
if (!$link) {
    die('Could not connect to MySQL: ' . mysql_error());
}
echo 'Connection OK'; mysql_close($link);
?>

And the error from the above:

Quote:    Warning: mysql_connect(): MySQL server has gone away in C:\xampp\htdocs\testmysql.php on line 2

    Warning: mysql_connect(): Error while reading greeting packet. PID=8108 in C:\xampp\htdocs\testmysql.php on line 2

    Warning: mysql_connect(): MySQL server has gone away in C:\xampp\htdocs\testmysql.php on line 2

    Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\testmysql.php on line 2

Sorry for the long post, but trying to get whatever information or thoughts out there.  Any more ideas or thoughts are quite welcome!
Reply
#12

(01-27-2016, 03:43 PM)nairb Wrote: I've been trying out most, if not all, of the suggestions.  I may be getting closer to the problem, and would welcome some further thoughts.

It looks like it is nothing to do with CI (or at least I'm not that far yet) and a connection problem or something related along those lines?

Code:
<?php
$link = mysql_connect('localhost:122','nairb','nairb');
if (!$link) {
    die('Could not connect to MySQL: ' . mysql_error());
}
echo 'Connection OK'; mysql_close($link);
?>
Well, I hope you're enjoying the challenge and not under any big deadline!
Do you have a PHP-based SQL admin tool like Adminer or PHPMyAdmin? Can you do http://localhost:122/phpmyadmin and it works?
If it doesn't, I'd say it has something to do with either IIS or that you're using a port number, though why shouldn't you be able to do that? As for IIS, are you able not to run it or do you have something else that requires IIS?
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
Reply
#13

(This post was last modified: 01-27-2016, 04:06 PM by nairb.)

(01-27-2016, 03:52 PM)RobertSF Wrote: Well, I hope you're enjoying the challenge and not under any big deadline!
Do you have a PHP-based SQL admin tool like Adminer or PHPMyAdmin? Can you do http://localhost:122/phpmyadmin and it works?
If it doesn't, I'd say it has something to do with either IIS or that you're using a port number, though why shouldn't you be able to do that? As for IIS, are you able not to run it or do you have something else that requires IIS?

Yes, I can run http://localhost:122/phpmyadmin without issue, or most any page I make unless it is the CI or another DB type page.  All of my other websites are using IIS and why I need to keep that running for their development (I have other php sites running under IIS, but no db activity for testing), and needed to put this on another port, 122. (and, of course, the client would like this sooner than later, as always!)
Reply
#14

Did you add it to the Windows Host file?

1) C:\windows\System32\drivers\etc\hosts

Add your new http there.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#15

(01-27-2016, 04:05 PM)nairb Wrote: Yes, I can run http://localhost:122/phpmyadmin without issue, or most any page I make unless it is the CI or another DB type page.  All of my other websites are using IIS and why I need to keep that running for their development (I have other php sites running under IIS, but no db activity for testing), and needed to put this on another port, 122.  (and, of course, the client would like this sooner than later, as always!)

I'm pretty stumped. A fresh installation of CodeIgniter, the welcome page, doesn't access the database, so you'd expect it to run fine. What doesn't make sense is that http://localhost:122/phpmyadmin worked fine but your non-Codeigniter test script that tried to connect to the database didn't work. I mean, what is phpmyadmin doing that your script isn't.

Also, we've been talking about checking logs, so just to leave no stone unturned, did you also check the SQL logs?
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
Reply
#16

(01-27-2016, 04:18 PM)InsiteFX Wrote: Did you add it to the Windows Host file?

1) C:\windows\System32\drivers\etc\hosts

Add your new http there.

You lost me.  What should I add to the hosts file?
Reply
#17

(01-27-2016, 04:39 PM)RobertSF Wrote: I'm pretty stumped. A fresh installation of CodeIgniter, the welcome page, doesn't access the database, so you'd expect it to run fine. What doesn't make sense is that http://localhost:122/phpmyadmin worked fine but your non-Codeigniter test script that tried to connect to the database didn't work. I mean, what is phpmyadmin doing that your script isn't.

Also, we've been talking about checking logs, so just to leave no stone unturned, did you also check the SQL logs?

Nothing in sql logs either...
Reply
#18

I don't know if this is the answer, but a quick read here suggest that it should be localhost,122 instead of localhost:122 in your code (not in the URL). http://stackoverflow.com/questions/89576...ent-studio

Although... this question is about MS SQL and you're using MySQL?
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
Reply
#19

(This post was last modified: 01-27-2016, 09:00 PM by InsiteFX.)

# localhost name resolution is handled within DNS itself.
# 127.0.0.1       localhost
# ::1             localhost

I would check your MySQL installation and see what it set the port to be used.

With XAMPP MySQL is usually set to localhost and port 3306

I use VirtualHost

Code:
# BCIT CodeIgniter 3.0,4 Dev Testing
<VirtualHost *:80>
   DocumentRoot "\xampp\htdocs\bcit\public_html"
   ServerName ci.dev
   <Directory "\xampp\htdocs\bcit\public_html">
       Order allow,deny
       Allow from all
       AllowOverride All
       Require all granted
   </Directory>
</VirtualHost>

So in my host file I will have this setting

127.0.0.1  ci.dev
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#20

Well, lots of digging around, but I was able to get a test php file working that connects to the db and displays information. For this, I needed to change my connection to 127.0.0.1:3306 (as opposed to 122, which is for the server, and 3306 is for mysql). I also had problems with the user still not working and changed it to root. When I did that it started to work okay. I then was able to get a user working too. I had to change privileges around in phpmyadmin to get it to work correctly. So, at least I know I can connect now using a basic php file.

The downloaded/imported site still doesn't work. But, it now displays a bunch of code/sql and ends with an error of "Fatal error: Class 'User' not found in C:\xampp\htdocs\system\core\Loader.php on line 303"

So, not sure where I'm headed just yet.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB