0

I was working on a project with my client. I mostly do frontend work so I don't really understand what is wrong here.

We got a white label license of a prebuilt app that we worked over and redesigned completely on our local host (i use MAMP on mac). The app is working perfectly fine there and has no problems.

When I tried to transfer my app to my host server It wont load. it doesn't show a not found and such error when Like if I place a file there and purposely link it to the wrong page, the page is just blank

the hosting server and stuff works, if I place a random index.html file in the same folder it will show up.

My process was, copy over all the database stuff (MySQL) from one PHPmyadmin to the other.

I created a new database and user with full access for that.

Use the file manager and upload the zipped file and extract it on my server.

now the codeigniter part has the part of the code where it needs to link to, i needed to edit it the first time, it wouldn't work on my localhost otherwise.

The code goes like this.

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|   http://example.com/
|
| If this is not set then CodeIgniter will try guess the protocol, domain
| and path to your installation. However, you should always configure this
| explicitly and never rely on auto-guessing, especially in production
| environments.
|
*/
public $baseURL = 'http://localhost:8888/hr-prw';

I also have a databse.php and it has these lines of code.

/**
 * The directory that holds the Migrations
 * and Seeds directories.
 *
 * @var string
 */
public $filesPath = APPPATH . 'Database/';

/**
 * Lets you choose which connection group to
 * use if no other is specified.
 *
 * @var string
 */
public $defaultGroup = 'default';

/**
 * The default database connection.
 *
 * @var array
 */
public $default = [
    'DSN'      => 'mysql:host=localhost;dbname=root',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => 'root',
    'database' => 'root',
    'DBDriver' => 'MySQLi',
    'DBPrefix' => '',
    'pConnect' => true,
    'DBDebug'  => (ENVIRONMENT !== 'production'),
    'cacheOn'  => false,
    'cacheDir' => '',
    'charset'  => 'utf8',
    'DBCollat' => 'utf8_general_ci',
    'swapPre'  => '',
    'encrypt'  => false,
    'compress' => false,
    'strictOn' => false,
    'failover' => [],
    'port'     => 3306,
];

Now this is all of the stuff that runs locally on my MAMP and it works perfectly fine.

For the host I created a subdomain. Let's say my file location and the database info looks like this.

testnet.domain.hr/hr.prw

databse info: username: database_root password: databaseroot database name: database_root

Now I would love to know where do I need to put what to get this work cause when i type in.

https://testnet.domain.com/hr-prw/

it show a blank page with error 500 when I go to inspect network.

I tried to put the info in those two tables and edit in various different combinations but I had no luck, thank you a lot for your help.! If you need any more info just ask.

  • First thing that grabs me, `public $baseURL = 'http://localhost:8888/hr-prw';` as you are on a real web server the port will be `80` the default, unless you changed something. So just remove the port number completely – RiggsFolly Jan 05 '22 at 16:53
  • Second thing that grabs me. Its unlikely you would be allowed to use `root` as the MySQL user on a shared server – RiggsFolly Jan 05 '22 at 16:55
  • @RiggsFolly Thats the stock working part of the code i showed there. I replaced the HTTP part with my domain listed there and put my databases instead of root and that didn't work. Thats the part where I am stuck atm. – Marko Žilić Jan 05 '22 at 16:58
  • Didn't work how? What is the error? A 500 error is just a generic status code. You need to check the php error log on the server to find the detailed error details – ADyson Jan 05 '22 at 18:38
  • @ADyson okay will look up how to do that. basically, when I put in all the new details, its just shows a blank page. Like this https://imgur.com/hbtfHyM its just blank, if I make a typo and write /hr-pr instead of hr-prw i get this https://imgur.com/2RDxiSK a normal error. So something happens up it doesn't work either way – Marko Žilić Jan 05 '22 at 18:44
  • Does this answer your question? [How can I get useful error messages in PHP?](https://stackoverflow.com/questions/845021/how-can-i-get-useful-error-messages-in-php) – ADyson Jan 05 '22 at 18:58
  • There's probably a file called error_log located somewhere in your hosting account, look for that – ADyson Jan 05 '22 at 19:13
  • @ADyson thanks, will try then and get back to you – Marko Žilić Jan 05 '22 at 19:55

3 Answers3

1

Found the issue, INTL wasnt enabled on my host PHP version, that fixed everything.

0

Change public $baseURL = 'http://localhost:8888/hr-prw' value to your own domain or project root location like so

public $baseURL = 'http://example.com/hr-prw';
reignsly
  • 502
  • 4
  • 10
-1

you can binding from server with nginx or apache and then set from http://localhost:8888/hr-prw