Link to home
Start Free TrialLog in
Avatar of mattibutt
mattibuttFlag for United States of America

asked on

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
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

"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
Avatar of mattibutt

ASKER

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

ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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

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
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!