Solved

Web application deployment problem on Solaris

Posted on 2009-07-10
6
281 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
ID: 24826310
"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
ID: 24831219
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
ID: 24832176
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 11

Author Comment

by:mattibutt
ID: 24832283
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
ID: 31602217
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
ID: 24840396
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 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

22 Experts available now in Live!

Get 1:1 Help Now