Migrating from Windows to Linux - Database Error

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Migrating from Windows to Linux - Database Error

Postby ss32 » 25. March 2015 20:46

I'm new to XAMPP and need to migrate an old page from Windows to Linux. I have a fresh install and all of the demos work fine. When I move the contents of the htdocs folder over from the Windows install I get a 403 Error when loading localhost, which I fixed by changing permissions of htdocs to 755. Now I'm getting an error "Error establishing a database connection" and not sure where to go from here. Here are the permissions for /opt/lamp

Code: Select all
[root@carbon2 lampp]# ll
total 11588
drwxr-xr-x  5 root   root      4096 Mar 25 15:08 apache2
drwxrwxr-x  2 root   root     12288 Mar 25 15:09 bin
drwxr-xr-x  2 root   root      4096 Mar 25 15:09 build
drwxr-xr-x  2 root   root      4096 Mar 25 15:08 cgi-bin
-rwxr-xr-x  1 root   root     27372 Mar 25 15:08 ctlscript.sh
drwxr-xr-x  2 root   root      4096 Mar 25 15:09 docs
drwxrwxr-x  3 root   root      4096 Mar 25 15:08 error
drwxr-xr-x  8 root   root      4096 Mar 25 15:08 etc
drwxr-xr-x 14 nobody root      4096 Mar 25 15:43 htdocs
drwxr-xr-x  6 root   root      4096 Mar 25 15:08 htdocs_orig
drwxr-xr-x  3 root   root      4096 Mar 25 15:08 icons
drwxr-xr-x  2 root   root      4096 Mar 25 15:08 img
drwxr-xr-x 20 root   root     12288 Mar 25 15:09 include
drwxr-xr-x  2 root   root      4096 Mar 25 15:09 info
lrwxrwxrwx  1 root   root        16 Mar 25 15:09 lampp -> /opt/lampp/xampp
drwxr-xr-x 14 root   root     12288 Mar 25 15:09 lib
drwxr-xr-x  2 root   root      4096 Mar 25 15:08 libexec
drwxr-xr-x  2 root   root      4096 Mar 25 15:08 licenses
drwxr-xr-x  2 daemon daemon    4096 Mar 25 15:43 logs
drwxr-xr-x  7 root   root      4096 Mar 25 15:09 man
-rwx------  1 root   root   3361003 Jun 10  2013 manager-linux-x64.run
drwxr-xr-x 14 root   root     12288 Mar 25 15:09 manual
drwxr-xr-x  2 root   root      4096 Mar 25 15:09 modules
drwxr-xr-x  3 root   root      4096 Mar 25 15:08 mysql
drwxr-xr-x  2 root   root      4096 Mar 25 15:08 pear
drwxr-xr-x  3 root   root      4096 Mar 25 15:08 php
drwxr-xr-x  9 root   root      4096 Mar 25 15:08 phpmyadmin
drwxr-xr-x  3 root   root      4096 Mar 25 15:08 proftpd
-rw-r--r--  1 root   root       888 Mar 25 15:09 properties.ini
-rw-r--r--  1 root   root     73365 Nov 19 08:14 RELEASENOTES
drwxr-xr-x  2 root   root      4096 Mar 25 15:08 sbin
drwxr-xr-x 45 root   root      4096 Mar 25 15:09 share
drwxrwxrwx  2 daemon daemon    4096 Mar 25 15:08 temp
-rwx------  1 root   root   7968007 Mar 25 15:09 uninstall
-rw-------  1 root   root    257964 Mar 25 15:09 uninstall.dat
drwxr-xr-x  6 root   root      4096 Mar 25 15:43 var
-rwxr-xr-x  1 root   root     15201 Jul 22  2013 xampp
ss32
 
Posts: 3
Joined: 25. March 2015 20:09
Operating System: RHEL 6.5

Re: Migrating from Windows to Linux - Database Error

Postby Nobbie » 25. March 2015 21:58

Its not a question of file permissions, you have to apply some valid MySQL User Data and password. You must look into the PHP source code and find out, which data is required.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Migrating from Windows to Linux - Database Error

Postby ss32 » 26. March 2015 16:40

When you say which data is required, what specifically do you mean? I have no experience with MySQL before this. When I go to localhost/phpmyadmin I see a list of users, would it be one of these that needs to be granted access? Edit: Is there a speicifc php file that might have the relevant information?
ss32
 
Posts: 3
Joined: 25. March 2015 20:09
Operating System: RHEL 6.5

Re: Migrating from Windows to Linux - Database Error

Postby Nobbie » 27. March 2015 10:56

ss32 wrote:I have no experience with MySQL before this.


If you have no experience, you cannot solve this. You have to know PHP and PHP MySQL API and must apply a valid User and password for mysql connect, this is quite impossible without any experience.

ss32 wrote:Is there a speicifc php file that might have the relevant information?


This is very common practice, but i have not the faintest idea about your software project.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Migrating from Windows to Linux - Database Error

Postby ss32 » 27. March 2015 15:28

Nobbie wrote:
ss32 wrote:I have no experience with MySQL before this.


If you have no experience, you cannot solve this. You have to know PHP and PHP MySQL API and must apply a valid User and password for mysql connect, this is quite impossible without any experience.
Or I could learn how to do this right now.
Nobbie wrote:
ss32 wrote:Is there a speicifc php file that might have the relevant information?


This is very common practice, but i have not the faintest idea about your software project.

Surely there is a standard file structure; the configuration files can't vary that much. If it helps, here are the contents of /opt/lampp/htdocs

Code: Select all
total 436
-rwxr-xr-x  1 nobody root 147777 Mar 25 15:42 banner-v10-4.jpg
-rwxr-xr-x  1 nobody root  31391 Mar 25 15:42 banner-v8.jpg
drwxr-xr-x  2 nobody root   4096 Mar 25 15:43 css
-rwxr-xr-x  1 nobody root   1406 Mar 25 15:42 favicon.ico
drwxr-xr-x  9 nobody root   4096 Mar 25 15:42 icon
-rwxr-xr-x  1 nobody root    418 Mar 25 15:42 index.php
drwxr-xr-x  6 nobody root   4096 Mar 25 15:43 inventory
drwxr-xr-x  2 nobody root   4096 Mar 25 15:43 js
-rwxr-xr-x  1 nobody root  19930 Mar 25 15:43 license.txt
drwxr-xr-x  6 nobody root   4096 Mar 25 15:42 php-inventory
-rwxr-xr-x  1 nobody root   7195 Mar 25 15:43 readme.html
-rwxr-xr-x  1 nobody root    427 Mar 25 15:42 robots.txt
drwxr-xr-x 12 nobody root   4096 Mar 25 15:42 sciencelabinv
drwxr-xr-x  3 nobody root   4096 Mar 25 15:42 sideimages
drwxr-xr-x  6 nobody root   4096 Mar 25 15:42 stocks
-rwxr-xr-x  1 nobody root   4951 Mar 25 15:42 wp-activate.php
drwxr-xr-x  9 nobody root   4096 Mar 25 15:43 wp-admin
-rwxr-xr-x  1 nobody root    226 Mar 25 15:43 wp-atom.php
-rwxr-xr-x  1 nobody root    271 Mar 25 15:43 wp-blog-header.php
-rwxr-xr-x  1 nobody root   5008 Mar 25 15:43 wp-comments-post.php
-rwxr-xr-x  1 nobody root    244 Mar 25 15:42 wp-commentsrss2.php
-rwxr-xr-x  1 nobody root   2615 Mar 25 15:42 wp-config.php
-rwxr-xr-x  1 nobody root   2726 Mar 25 15:43 wp-config-sample.php
drwxr-xr-x  9 nobody root   4096 Mar 25 15:43 wp-content
-rwxr-xr-x  1 nobody root   2956 Mar 25 15:42 wp-cron.php
-rwxr-xr-x  1 nobody root    246 Mar 25 15:43 wp-feed.php
drwxr-xr-x 12 nobody root   4096 Mar 25 15:43 wp-includes
-rwxr-xr-x  1 nobody root   2380 Mar 25 15:42 wp-links-opml.php
-rwxr-xr-x  1 nobody root   2714 Mar 25 15:43 wp-load.php
-rwxr-xr-x  1 nobody root  33435 Mar 25 15:42 wp-login.php
-rwxr-xr-x  1 nobody root   8252 Mar 25 15:43 wp-mail.php
-rwxr-xr-x  1 nobody root    413 Mar 25 15:42 wp-pass.php
-rwxr-xr-x  1 nobody root    224 Mar 25 15:43 wp-rdf.php
-rwxr-xr-x  1 nobody root    334 Mar 25 15:42 wp-register.php
-rwxr-xr-x  1 nobody root    226 Mar 25 15:43 wp-rss2.php
-rwxr-xr-x  1 nobody root    224 Mar 25 15:43 wp-rss.php
-rwxr-xr-x  1 nobody root  11115 Mar 25 15:43 wp-settings.php
-rwxr-xr-x  1 nobody root  25152 Mar 25 15:43 wp-signup.php
-rwxr-xr-x  1 nobody root   4035 Mar 25 15:43 wp-trackback.php
drwxr-xr-x  5 nobody root   4096 Mar 25 15:42 xampp
-rwxr-xr-x  1 nobody root   3032 Mar 25 15:43 xmlrpc.php
ss32
 
Posts: 3
Joined: 25. March 2015 20:09
Operating System: RHEL 6.5

Re: Migrating from Windows to Linux - Database Error

Postby Nobbie » 27. March 2015 20:45

ss32 wrote:Or I could learn how to do this right now.


I totally agree and wish good luck to you. It will take a lot of time.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 30 guests