Web application deployment problem on Solaris

hi
i have a web application developed using php mysql , i am trying to deploy this on Solaris Web Stack but it doesnt work i dont know how can i debug the app like what are the things making the application not work, if anyone has already done that it would great to know kind of things i need to look for in order to debug this application
LVL 11
mattibuttAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
"it doesnt work" is not really useful information. Sort of like saying, "my car won't move."  Without a little more we can't tell whether that is because the motor is turned off, or a tree fell on it, or it is up on blocks.

Try to give us some details about the symptoms and tell us what you have tried to fix the issues.  Thanks, ~Ray
0
mattibuttAuthor Commented:
hi Ray
its good to hear from you after a while well i am trying to deploy web application on solaris platform it uses web stack bundle from sun when i run the site i simply see the following php code (see code snippet)  i remember you helped me once to debug the application once so i am hoping to hear your thoughts on this issue.
i have tested the platform the php and database is configured but the web application which i want to deploy is not working at all

", "'", '"'), "", $referer); $referer = preg_replace('|https?://[^/]+|i', '', $referer ); return $referer; } return false; } /* this function checks if the current user is logged in. */ function reset_password($email_address = ''){ global $conn_id; if( empty($conn_id) ) { $conn_id = db_connect(); } if(empty($email_address) || $email_address == '') return 0; $new_pass = generate_unique_id(); $activation_key = generate_activation_key(); $new_md5 = md5($new_pass); $sql = "UPDATE pm_users SET new_password = '".$new_md5."', activation_key = '".$activation_key."' WHERE email= '".$email_address."'"; $result = @mysql_query($sql, $conn_id); if( !$result ) return 0; return array("pass" => $new_pass, "key" => $activation_key); } /* this function returns an array with the user's information FROM pm_users Table */ function fetch_user_info($username){ global $conn_id; $buffer = str_replace(" ", "", $username); if( !ctype_alnum($buffer) ) return 0; if( empty($conn_id) ) { $conn_id = db_connect(); // this function, db_connect() is defined in 'include/functions.php'; } $user = array(); $sql = "SELECT * FROM pm_users WHERE username= '".$username."'"; $result = @mysql_query($sql, $conn_id); if( !$result ) return false; $count = @mysql_num_rows($result); if( !$count ) return false; $row = @mysql_fetch_assoc($result); @mysql_free_result($result); foreach($row as $k => $v){ $user[$k] = stripslashes($v); } @mysql_query("UPDATE pm_users SET last_signin = '".time()."' WHERE username = '".$username."'"); return $user; } function fetch_user_advanced($unique_id = '') { global $conn_id; if( empty($conn_id) ) { $conn_id = db_connect(); // this function, db_connect() is defined in 'include/functions.php'; } $user = array(); if(empty($unique_id)) return false; $sql = "SELECT * FROM pm_users WHERE id= '".$unique_id."'"; $result = @mysql_query($sql, $conn_id); if( !$result ) return false; $count = @mysql_num_rows($result); if( !$count ) return false; $row = @mysql_fetch_assoc($result); @mysql_free_result($result); foreach($row as $k => $v){ $user[$k] = stripslashes($v); } return $user; } function generate_unique_id(){ return substr(md5(uniqid(time(), true)), 0, 7); } function username_to_id($username) { if(!$username) return false; $username = trim($username); $username = secure_sql($username); $sql = "SELECT id FROM pm_users where username LIKE '".$username."'"; $result = mysql_query($sql); if(!$result) return 0; $total = mysql_num_rows($result); if($total > 0) { $r = mysql_fetch_assoc($result); mysql_free_result($result); return $r['id']; } return 0; } function banlist($user_id) { $sql = "SELECT * FROM pm_banlist WHERE user_id = '".$user_id."'"; $result = mysql_query($sql) or die(mysql_error()); if(!$result) return false; $ban = array(); if(mysql_num_rows($result) > 0) $ban = mysql_fetch_assoc($result); return $ban; } ?>

Open in new window

0
Ray PaseurCommented:
Looks like we are missing something in that code snippet - it seems to start in the middle of a statement.

Any chance you have the code with line feeds and appropriate indenting?  It would be so much easier to read!

Also, please tell us what you mean by "not working" - are there error messages, does it catch fire ;-)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

mattibuttAuthor Commented:
hi ray
i have deployed the application on linux based platform where it is functioning perfectly fine no problem there where i am testing it but for the final deployment phase i want to deploy on solaris the web application doesnt work at all .
basically i see what i have shown you in the previous post this is what it displays. i have checked the apache log and i see the following errors
[Sat Jul 11 11:17:39 2009] [error] [client 10.12.48.253] PHP Notice:  Undefined index:  HTTP_HOST in /var/virtualhosts/web/include/settings.php on line 67
[Sat Jul 11 11:17:39 2009] [error] [client 10.12.48.253] PHP Notice:  Undefined variable: langs in /var/virtualhosts/web/include/settings.php on line 203
[Sat Jul 11 11:17:39 2009] [error] [client 10.12.48.253] PHP Notice:  Undefined variable: lang_id in /var/virtualhosts/web/include/settings.php on line 204
[Sat Jul 11 11:17:39 2009] [error] [client 10.12.48.253] PHP Fatal error:  Call to undefined function is_user_logged_in() in /var/virtualhosts/web/include/islogged.php on line 14
 
NameVirtualHost *:80
NameVirtualHost *:443
 
<VirtualHost *:80>
 ServerName mydomain
 
 DocumentRoot /var/virtualhosts/web
 
 ErrorLog /var/log/httpd/mydomain.error-log
 CustomLog /var/log/httpd/mydomain.access-log combined  
 
 <Directory /var/virtualhosts/web>
  Options All
  Order Allow,Deny
  Allow from All
 </Directory>
 
</VirtualHost>

Open in new window

0
mattibuttAuthor Commented:
thanks buddy for your help you always make me think hard lol and its a very good tactics apparently the reason of php errors was the server wasnt configured with short php tags and few directory write permission issues but now it seems ok i have another problem now everything else works fine except one poll if you dont mind i will send you a link for this new question.
thank you
0
Ray PaseurCommented:
Thanks for the points - that "short tags" thing is like "register_globals" and "magic quotes" - from one installation to another, you can find a lot of ways these features will make a script fail.  Better to avoid them all the time!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.