Solved

Web application deployment problem on Solaris

Posted on 2009-07-10
6
279 Views
Last Modified: 2013-12-13
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
0
Comment
Question by:mattibutt
  • 3
  • 3
6 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
"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
 
LVL 11

Author Comment

by:mattibutt
Comment Utility
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
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 11

Author Comment

by:mattibutt
Comment Utility
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
 
LVL 11

Author Closing Comment

by:mattibutt
Comment Utility
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
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
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

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now