Alias in Virtual Server

12 posts / 0 new
Last post
#1 Mon, 12/20/2010 - 08:52

Alias in Virtual Server


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 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

Thanks for any help

Mon, 12/20/2010 - 10:15

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:

That's a nice and simple way of testing sites before their DNS is live.


Mon, 12/20/2010 - 10:45

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] 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

Mon, 12/20/2010 - 11:50

Yeah, it could be that extension_dir. Try commenting that out and see if that helps.


Mon, 12/20/2010 - 12:09

/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 ? 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.

Mon, 12/20/2010 - 12:08

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 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.


Mon, 12/20/2010 - 12:11

just a casuality, I edited the previous post with that info.

So I would change it to lib64. Anyway the problem is still there.

Mon, 12/20/2010 - 12:20

Using "Preview website" there's no mysql problem... Where are logged eventual apache php errors of previews?

Mon, 12/20/2010 - 14:27

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.


Mon, 12/20/2010 - 19:34

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/ or a variant of that by default). Doing this can cause all kinds of side-effects.

Tue, 12/21/2010 - 08:47

Yes, you're right. All files are in /home/domain/public_html. Some read-only are in /home/domain

Thu, 10/17/2013 - 15:10

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)

Topic locked