Moving Application

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
udennison
Posts: 18
Joined: 2019-10-12 17:34
Location: Trinidad & Tobago

Moving Application

Post by udennison » 2021-02-03 16:26

Good day,

I'm attempting to move an application from my local computer to a web server.
I've followed the instructions in this post https://bigprof.com/blog/appgini/moving ... ew-server/ a few times and this is the error msg I'm continuously getting. I couldn't apply a couple steps; step 7 to delete the .maintenance, because the application is not in production and does not require a maintenance mode. Below are the error msgs I'm getting. Assistance appreciated, thank you.

Warning: include(C:\xampp\htdocs\legalmatters/updateDB.php): Failed to open stream: No such file or directory in C:\xampp\htdocs\legalmatters\setup.php on line 139

Warning: include(): Failed opening 'C:\xampp\htdocs\legalmatters/updateDB.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\legalmatters\setup.php on line 139

Fatal error: Uncaught Error: Call to undefined function get_magic_quotes_gpc() in C:\xampp\htdocs\legalmatters\setup.php:32 Stack trace: #0 C:\xampp\htdocs\legalmatters\setup.php(144): undo_magic_quotes('localhost') #1 {main} thrown in C:\xampp\htdocs\legalmatters\setup.php on line 32

hgarbe
Veteran Member
Posts: 57
Joined: 2020-01-21 17:35

Re: Moving Application

Post by hgarbe » 2021-02-04 23:05

Hi,
as you probably seen this blog entry aims at move a productive app with productive data to another server without inconsistencies. As you self wrote it's not productive why would you want to move it? Can't you just directly deploy the appgini files to that server?

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: Moving Application

Post by SkayyHH » 2021-02-05 07:14

Hi,

you don't need a "Maintenance mode" if you don't have any users on the system :-)

Normally it should work like this:

1.) Copy the app directory with the generated files and directories to the server. Make sure to transfer the files in ascii or binary mode.

Ascii:

*.php
*.css
*.js
*.txt
*.htm
*.html
*.htaccess
*.md
*.json

Hope these are all...

2.) If available delete config.php and setup.md5

3.) Run setup and enter the database data.

4.) Set file permissions (dir 755, files 644 i think)

5.) Delete setup.php

6.) If you want to transfer the data from the database run a sql dump local and import the dump on the server. With PHPmyAdmin or the AppGini backup function.

I hope this works for you.

udennison
Posts: 18
Joined: 2019-10-12 17:34
Location: Trinidad & Tobago

Re: Moving Application

Post by udennison » 2021-02-05 16:14

Hi, thanks for taking time to respond. Yes, these are the steps taken, except for no 4.) above, set file permissions. Please elaborate on this step.
I did delete the config.php and setup.md5 and ran the setup.

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: Moving Application

Post by SkayyHH » 2021-02-05 16:19

Are you sure that you specified the server correctly during setup? You have something from "localhost" in the error message.

udennison
Posts: 18
Joined: 2019-10-12 17:34
Location: Trinidad & Tobago

Re: Moving Application

Post by udennison » 2021-02-05 17:00

Yes, on the web server it is localhost. It is a web server that is located on the internal network.

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: Moving Application

Post by SkayyHH » 2021-02-06 09:51

Localhost (127.0.0.1) is your own local computer. Have you ever tried the IP number of the web server?

udennison
Posts: 18
Joined: 2019-10-12 17:34
Location: Trinidad & Tobago

Re: Moving Application

Post by udennison » 2021-02-06 11:52

On the Setup Data page, with the IP address I get a connection error. Using localhost it is successful.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Moving Application

Post by jsetzer » 2021-02-06 12:44

For narrowing down I recommend verifying the serverside database connection parameters by using a different tool than AppGini setup.

Recommendation
  1. Download Adminer
    https://www.adminer.org/de/#download
    Direkt download link:
    https://github.com/vrana/adminer/releas ... -mysql.php
  2. Upload the file to your server
    For example create a directory "db" under your web-root directory
  3. Open that tool in your browser
    For example navigate to https://www.myserver.xyz/db
    The adminer-VERSION.php file will be listed. Open it.
  4. In the login form, try to connect to your database with localhost and your db-administrative credentials. Leave the database-field empty for now.
    • If login fails, there is a problem with your database setup, permissions or credentials
      In this case it does not make sense to play around with AppGini setup parameters but to find the correct connection settings, credentials and permissions serverside.
    • If you can connect, find your database name in the upper left dropdown list. Your database should be present.
  5. for security reasons: remove Adminer (or protect it against unauthorized access)
It would help us helping you if you could report back the results of your database connection test.
Attachments
devenv_W4EotfEgbN.png
devenv_W4EotfEgbN.png (14.8 KiB) Viewed 4037 times
Last edited by jsetzer on 2021-02-06 12:53, edited 2 times in total.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: Moving Application

Post by SkayyHH » 2021-02-06 12:46

Hi,

I have looked into the Setup.php.

In 136 to 139 it says

Code: Select all

		/* if db test is successful, output success message and exit */
		if($test) {
			echo 'SUCCESS!
			exit;
That means you will get a "success" at the setup screen if the database details are correct.

Is that so?

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Moving Application

Post by onoehring » 2021-02-08 09:45

Hi,


I strongly suggest you try Jans "connect to database" tip above.

Did you try the "real" server with a plain html or php document? Like
index.php

Code: Select all

echo "hello";
? Does that work?
I am just wondering as your "real" server seems to be Windows based which is ... uncommon.

Olaf

udennison
Posts: 18
Joined: 2019-10-12 17:34
Location: Trinidad & Tobago

Re: Moving Application

Post by udennison » 2021-02-08 12:30

Apologies for the delay, the laptop took the weekend away from me.
I've tried the tip from @jsetzer, downloaded Adminer and was successful connecting to the database.

I tried the tip from @hgarbe by installing appgini on the webserver and running the project file from there, no success. I may have to recreate the project from scratch going down this route. It wasn't difficult with the gini, took a day or so.

@Skayhh, I did get success connecting to the database on the setup page.

@oneehring, it is Windows based and there is another plain php project that is connecting.

Various attempts keep pointing to this line in the setup.php code on line 32

/* some function definitions */
function undo_magic_quotes($str) {
return (get_magic_quotes_gpc() ? stripslashes($str) : $str);
}

Thanks for the help, any further tips?

udennison
Posts: 18
Joined: 2019-10-12 17:34
Location: Trinidad & Tobago

Re: Moving Application

Post by udennison » 2021-02-19 15:47

Sorry for the long delay, only made time today to advance this concern.
I resorted to using a lower version of xampp and the Appgini applications worked seemlessly.
The webserver's OS is Windows 2008 R2. The version of xampp was x64-8.0.0-3-VS16 and I uninstalled it and instated version 7.2.33.
Thanks again for all who assisted.

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: Moving Application

Post by SkayyHH » 2021-02-20 08:24

I can confirm that. AppGini does not seem to run under the latest Xaamp 8. Maybe Xaamp 8 needs to be configured first. With Xaamp 7.x it runs well.

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Moving Application

Post by onoehring » 2021-02-20 08:46

Hi,

maybe it'php 8 ... and there is a problem?
xammp.png
xammp.png (60.51 KiB) Viewed 3815 times
Olaf

Post Reply