Solved

Web application deployment problem on Solaris

Posted on 2009-07-10
6
288 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 110

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 110

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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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 110

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WordPress  Failed to Import Media 8 64
CSS Formatting Getting Stripped 1 35
SSL unsecure page mystery 17 45
replacate wordpress websites 3 22
These days socially coordinated efforts have turned into a critical requirement for enterprises.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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.

739 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