Welcome Guest, Not a member yet? Register   Sign In
How do I get this CI php application to run from my local machine [WAMP]
#1

[eluser]justmelat[/eluser]
I need help with what I thought was going to be simple local machine set up.

We have a php codeIgniter app on our staging and of course production servers. I have been making my edits on staging, testing, confirming then moving production. Looks like we'll be making some significant changes in the near term so I decided I'd move the staging code to my local machine so I can really hack away at it. As embarrassing as this is, I can't get this php app configured to run on my local machine to save my life. Now after more than a week of trying, I'm pasted embarrassed, into frustration and sliding into desperation. It's not like I haven't installed apps on my local machine before, but this one is killing me.

Some insight about this app. This is one supply requisition app that multiple clients have access to and course is regulated by the client account number.

Client "Ahh" types in [ahh.supplygrp.com] into their browser, url takes them to their login page, they log in and access all 'their' company related info. Client "Bee" types in [bee.supplygrp.com] into their browser, url takes them to their login page, they login and access all 'their' company related info and so on.

The Ahh and Bee are the acct_name, [see db schema attached]so the url goes to server, finds the app, looks in the db for Ahh or Bee, if found, appends the servername, opens that url which would be ahh.supplygrp.com, shows login page, successful login>> off you go.

I know I am tripping over the servername, virtual host, host file, config file rules. I am missing something and I don't know what. I have set a new install of easyphp5++ [WAMP] on my PC, verified it works with basic php page and a generic install of Codeigniter. I've also installed the app in question along with it's db.

Can anyone walk me thru what I need to do as it relates to the server, host file, config files, virtualhost configurations to get this app running on my local machine.

Config file, acct schema are attached for reference.

Much thanks in advance.

Code:
CREATE TABLE `supplyGrp_accts_tbl` (
  `id` int(5) NOT NULL auto_increment,
  `acct_name` varchar(128) NOT NULL,
  `acct_url` varchar(256) default NULL,
  `logo_url` varchar(256) default NULL,
  `created_by` int(10) default NULL,
  `created_date` datetime default NULL,
  `modified_by` int(10) default NULL,
  `modified_date` datetime default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
*--------------------------------------------------------------------------
* Settings - This file contains configuration parameters of application
*--------------------------------------------------------------------------
* @author The Dev Team
* @created 2/12/2011
* @version 1
*--------------------------------------------------------------------------
*/

$svrEnv = getenv("SUPPLYGRP_ENV");

if($svrEnv == "PROD")
{
//BASE URL
$BASE_URL = "https://".$_SERVER['SERVER_NAME'];

//DATABASE SETTINGS
$DB_HOST = "localhost";
$DB_USER = "supplygrp";
$DB_PASSWORD = "sg3dev2";
$DB_NAME = "supplygrp";

//EMAIL SETTINGS
$SEND_EMAILS = TRUE;
$EMAIL_PROTOCOL = "SMTP";     //mail OR sendmail OR smtp
//set smtp details
$EMAIL_SMTP_HOST = "mail.devgrp3t.net";
$EMAIL_SMTP_PORT = "25";
$EMAIL_SMTP_AUTH_REQUIRED = FALSE;
$EMAIL_SMTP_SECURE = "";      // '' OR ssl OR tls
$EMAIL_SMTP_USERNAME = "";
$EMAIL_SMTP_PASSWORD = "";

//FILE UPLOAD SETTINGS
$UPLOAD_DIRECTORY_PATH = "uploads/";
$UPLOAD_DIRECTORY_FULL_PATH = "/sites/supplygrp/uploads/";
$UPLOAD_LOGO_PATH = "logos/";
$MAX_UPLOAD_SIZE = 10;     //In MB
$MAX_UPLOAD_SIZE_PER_REQUEST = 10;  //In MB
}
elseif($svrEnv == "TEST")
{
//BASE URL
$BASE_URL = "http://".$_SERVER['SERVER_NAME'];

//DATABASE SETTINGS
$DB_HOST = "localhost";
$DB_USER = "supplygrp";
$DB_PASSWORD = "sg3dev2";
$DB_NAME = "supplygrp";

//EMAIL SETTINGS
$SEND_EMAILS = TRUE;
$EMAIL_PROTOCOL = "SMTP";     //mail OR sendmail OR smtp
//set smtp details
$EMAIL_SMTP_HOST = "localhost";
$EMAIL_SMTP_PORT = "25";
$EMAIL_SMTP_AUTH_REQUIRED = FALSE;
$EMAIL_SMTP_SECURE = "";      // '' OR ssl OR tls
$EMAIL_SMTP_USERNAME = "";
$EMAIL_SMTP_PASSWORD = "";

//FILE UPLOAD SETTINGS
$UPLOAD_DIRECTORY_PATH = "uploads/";
$UPLOAD_DIRECTORY_FULL_PATH = "/usr/local/sites/supplygrp/uploads/";
$UPLOAD_LOGO_PATH = "logos/";
$MAX_UPLOAD_SIZE = 10;     //In MB
$MAX_UPLOAD_SIZE_PER_REQUEST = 10;  //In MB
}
elseif($svrEnv == "DEVL")
{
//BASE URL
$BASE_URL = "http://".$_SERVER['SERVER_NAME']."/supplygrp/www/";

//DATABASE SETTINGS
$DB_HOST = "localhost";
$DB_USER = "supplygrp";
$DB_PASSWORD = "sg3dev2";
$DB_NAME = "supplygrp";

//EMAIL SETTINGS
$SEND_EMAILS = FALSE;
$EMAIL_PROTOCOL = "SMTP";     //mail OR sendmail OR smtp
//set smtp details
$EMAIL_SMTP_HOST = "";
$EMAIL_SMTP_PORT = "";
$EMAIL_SMTP_AUTH_REQUIRED = FALSE;
$EMAIL_SMTP_SECURE = "";      // '' OR ssl OR tls
$EMAIL_SMTP_USERNAME = "";
$EMAIL_SMTP_PASSWORD = "";

//FILE UPLOAD SETTINGS
$UPLOAD_DIRECTORY_PATH = "uploads/";
$UPLOAD_DIRECTORY_FULL_PATH = "C:/easyphpwebserver/www/supplygroup/uploads/";
$UPLOAD_LOGO_PATH = "logos/";
$MAX_UPLOAD_SIZE = 4;     //In MB
$MAX_UPLOAD_SIZE_PER_REQUEST = 8;  //In MB
}

?>
#2

[eluser]Otemu[/eluser]
Not sure if you resolved this matter but to test this quickly you should remove all the if and else statements, then delete all the different enviroment config settings apart from one.

Then run tests on that single configuration, most likely the database settings will be different for your local so your need to get the correct details and change base url from https to http if your using secure version base url, I think that be a good place to start.

Hope that helps
#3

[eluser]InsiteFX[/eluser]
You do not delete them! Youy remark them out. Remember this coming from a live server...
#4

[eluser]Otemu[/eluser]
[quote author="InsiteFX" date="1331570569"]You do not delete them! Youy remark them out. Remember this coming from a live server...
[/quote]

Good point, although it was just a test for him to try, once his resolved the issue then he can put back all the live, prod and testing server data but yes commenting out would be much better
#5

[eluser]justmelat[/eluser]
Yes I did get this working - finally - i a user on another board was able to point me in the right direction
Issues: Host files correctly pointing to url, virtualhost file in easyphp correctly set, turn short-tags on in php configure files, can even debug codeigniter using netbeans and zend.

regarding the IF statement you mentioned above, I simple made the last else/if and ELSE, so the code would fall thru to that section of code.




Theme © iAndrew 2016 - Forum software by © MyBB