These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Alias in Virtual Server on the new forum.
Hello,
For testing purposes before websites go to production I have some Alias defined in main Virtual Server.
Alias /theSite "/home/theSite/public_html" to get http://mainDomain.com/theSite to open web content /home/theSite/public_html
My old sever does the job alright but doing the same in my new server I get PHP Fatal error: Call to undefined function mysql_connect() in...
Some of my domains are already in production with no mysql connection problems but failed using the Alias http://mainDomain.com/theSite
Thanks for any help
Hmm, it sounds like PHP's MySQL module isn't being loaded. You're saying other domains on the same server are using MySQL?
If so, it sounds like something is going on that's preventing your new site from loading MySQL. One possibility is that the extension_path set in the php.ini for that particular domain is wrong. You may want to take a look in the domain's error_log file to get some specifics though -- that's in $HOME/logs/error_log.
Also, you may want to check out Virtualmin's alias feature described in here:
http://www.virtualmin.com/documentation/web/faq
That's a nice and simple way of testing sites before their DNS is live.
-Eric
You know that first domains I tested in that way went fine. Last one gets into trouble, and testing again previous domains, all of them are in the same trouble. This is a line of the error log [Mon Dec 20 14:23:55 2010] [error] [client 66.249.72.212] PHP Fatal error: Call to undefined function mysql_connect() in /home/theSite/public_html/Connections/conn.php on line 9
conn.php contains the mysql data for database connection
I'll look into your link. Anyway I am worried about this because the same test from my old server, still working, is fine.
Both servers have a clean Virtualmin install. Something has changed during server move that affected mysql connection in that way.
extension_path is not set in /home/../etc/php.ini There is extension_dir = "/usr/lib64/php/modules"
Thank you
Yeah, it could be that extension_dir. Try commenting that out and see if that helps.
-Eric
/etc/php.ini extension_dir = "/usr/lib/php/modules"
/home/.../etc/php.ini extension_dir = "/usr/lib64/php/modules"
Is it correct lib64 vs lib ? mysql.so is located inside lib64 dir.
I commented both but nothing has change I also created a new VS with an alias and put it at top of VSs to see if my Main VS has a setting fault. Same problem.
The extension_dir to use depends on your distro and architecture... just take a look at the actual path and see if there's a mysql.so in that dir :-)
It sounds like there's several domains that work on your server -- that means whatever extension_dir setting they're using is the correct one.
-Eric
just a casuality, I edited the previous post with that info.
So I would change it to lib64. Anyway the problem is still there.
Using "Preview website" there's no mysql problem... Where are logged eventual apache php errors of previews?
If there are any errors, they would all show up in the Apache logs of the Virtual Server that owns the website being viewed... those are in $HOME/logs/error_log.
-Eric
Just to make sure: Are the files in
/home/thesite
owned by the correct user/group and set to the correct permissions?Actually it's unusual to put files for a domain outside the home directory of that domain (which should be
/home/maindomain.com
or a variant of that by default). Doing this can cause all kinds of side-effects.Yes, you're right. All files are in /home/domain/public_html. Some read-only are in /home/domain
just like to comment on this so it helps
had problems when moving a site across from one server to a new one (using Cloudmin replicate) I was getting an error "Call to undefined function mysql_connect"
extension_dir = "/usr/lib/php/modules" new server is now 64 bit and so PHP needs this set to 'lib64' extension_dir = "/usr/lib64/php/modules"
took me quite some time to solve this problem, but thanks to the above posts I got it :o)