Want To Start Tomcat From Php
i wan tto start jakarta-tomcat-5.5.3 from the webbrowser using the
sheel scripts...i normally use the shell scripts from the command line
to start and stop the tomcat server.....
i found out that php gives this incredible facility where i can execute
normal bash commands...i tried doing so ..but a simple command like {
system('whoami') } from
browser......eg.....http://localhost/startup.php..
prints apache as the user....so technically it executes the tomcat
startup script as apache user..but ive got
jakarta-tomcat-5.5.3 under the tomcat user....can someone please tell
me is there a way in php coding wherein i can execute the command as
another....i know this seems a bit out of place...but i really didnt
know anywhere else to go
View Complete Forum Thread with Replies
Related Forum Messages:
PHP And Tomcat?
I hope this is the right forum for this topic. I've just recently started working at a new job. It looks like the previous web developer had started to play around with some jsp pages on our intranet. I would like to continue the idea of databasing some of the information but I don't have time to learn jsp so I'd like to stick with PHP. Eventually I'd like to implement these features on our internet site too. Anyway, he had setup Tomcat and I was wondering if it is possible to continue to run the jsp apps that he had created but also run PHP pages at the same time. I'm pretty new to all of this so I probably haven't explained it very well but I was hoping some of the experts here could point me in the right direction.
View Replies !
PHP & Tomcat
We are getting new computers at work and I got the word today that pc-lan (network admins) do not want IIS installed on ANY machine. We are primarily a Java development house, so they will not balk about me installing Tomcat. Can I run PHP from Tomcat the same (or close to) as IIS?
View Replies !
PHP On Tomcat As CGI
I'm trying to get PHP running as a CGI app on Tomcat. I've managed to do sufficent Tomcat setup to get it to invoke the PHP interpreter, but all I get is the feared "No input file specified." Looking aroung the php site, it seems this is caused by PHP-cgi really wanting to be passed SCRIPT_FILENAME. Looking at the Tomcat logs, it seems this is not being passed. I'm investigating how to get Tomcat to pass this variable, but in case that dosn't work, can anyone answer these: * does SCRIPT_FILENAME cause this in other webservers? * if (and how) can I get php to be less hung up on seeing this variable? System: PHP 5.0.1 (cgi-fcgi) (built: Aug 12 2004 23:30:44) Apache Tomcat 5.0.27 Server Windows XP (I don't like it either, but these hands are tied) Config: I used the php.ini-dist from the package and have changed the following: * I had to set [cgi.force_redirect = 0] to get this far. * I've tried changing doc_root to the directory where my php files are (C:Tomcat5webappsROOTWEB-INFcgi), without any luck. Env vars being passed via CGI: HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1 HTTP_ACCEPT_ENCODING=gzip,deflate REQUEST_METHOD=GET AUTH_TYPE= HTTP_ACCEPT_LANGUAGE=en-us,en;q=0.5 SERVER_NAME=127.0.0.1 SERVER_SOFTWARE=TOMCAT HTTP_KEEP_ALIVE=300 HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_HOST=127.0.0.1 GATEWAY_INTERFACE=CGI/1.1 X_TOMCAT_SCRIPT_PATH=C:Tomcat5webappsROOTWEB-INFcgifoo.php REMOTE_ADDR=127.0.0.1 SERVER_PROTOCOL=HTTP/1.1 HTTP_CACHE_CONTROL=max-age=0 PATH_INFO= REMOTE_HOST=127.0.0.1 QUERY_STRING= HTTP_CONNECTION=keep-alive SERVER_PORT=80 CONTENT_TYPE= CONTENT_LENGTH= HTTP_ACCEPT=text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 SCRIPT_NAME=/cgi-binfoo.php REMOTE_USER= REMOTE_IDENT= command=C:Tomcat5webappsROOTWEB-INFcgifoo.php
View Replies !
[How To Use Php Files In Tomcat 5]
I try to see my PHP files through tomcat. Tomcat 5.0.25 (from binaries) PHP 4.3.3 (from RPMs) Linux Suse 9.0 A message asks me to download my PHP file; I cannot open it in my browser through tomcat server while I can easily do this through apache2 server. It 's like PHP wasn't interpretted by tomcat. I added this in $CATALINA_HOME/conf/web.xml: <welcome-file>index.php</welcome-file> <welcome-file>index.php5</welcome-file> <welcome-file>index.php4</welcome-file> <welcome-file>index.php3</welcome-file>
View Replies !
Php5 On Tomcat
which is the best method of doing this? All I need is to be able to run a php script. I wouldn't need to mix java and php together. Basocally it would be a pure php script I will be running on tomcat.
View Replies !
Configure Tomcat To Run PHP Scripts
I am trying to configure Tomcat5.5 to run PHP5.2.5 scripts on linux machine. I got some information from <a target="_blank" rel=nofollow href="http://wiki.apache.org/tomcat/UsingPhp">[link]</a> as how to do this. First, It says to apply patch to configuration file and then apply a patch to sapi/servlet/servlet.java. But I am stuck at...
View Replies !
Mapping PHP5 To Tomcat+phpservlet
I have PHP5 in my localhost (windows) environment .. for development. And using phpservlet.war (in java) I have been able to run PHP5 in cgi mode on my local tomcat 5.0.29 server. I use PHP on tomcat to run with some other tomcat webapps, so an Apache+PHP5 installation is not what I need (although I have that working too on a different port in my localhost). Code:
View Replies !
Scripts In Tomcat 5.0.5 On Linux 9 Platform
i have to go with the task to run php5 or php4 in tomcat 5.0.5 on linux 9 platform i have no idea about how to run php scripts in tomcat 5.0.5 on linux 9 platform. i got it in the Win XP,windows nt server 2000, but not in linux 9 would u please help me with the steps to configure.
View Replies !
Warning: Session Start() [function.session-start]: Open(/tmp/sess 8b10
Hello. Could someone tell me why i am getting these warnings on my php pages? And what i can do to fix it? Thanks. Warning: session_start() [function.session-start]: open(/tmp/sess_8b107ef6a1cde0a7426aedc044c14cb2, O_RDWR) failed: Disk quota exceeded (122) in /home/ployjam/public_html/admin/login.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/ployjam/public_html/admin/login.php:2) in /home/ployjam/public_html/admin/login.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/ployjam/public_html/admin/login.php:2) in /home/ployjam/public_html/admin/login.php on line 2 Warning: Cannot modify header information - headers already sent by (output started at /home/ployjam/public_html/admin/login.php:2) in /home/ployjam/public_html/admin/login.php on line 23 Warning: Unknown: open(/tmp/sess_8b107ef6a1cde0a7426aedc044c14cb2, O_RDWR) failed: Disk quota exceeded (122) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0
View Replies !
Better To Start With <? Or <?php
Is starting with <? the same as <?php . The reason I asked was that after reading a few tutorials I have seen them both use <? and <?php sometimes. Why not use <? since its only 2 chars compared to 5?
View Replies !
Not Sure Where To Start
I have a page with the letters ABCDE...etc I want to be able to click on a letter and it will bring up a list of title's to click on, so how do I get it to load a page if say A was index.php?reviews=a I've already got the page with the links in and that then loads the reviews up if you click on the link, but I've made 26 pages areview, breview, creview etc. I would just rather have a common page that would choose the right one. Is this a simple answer or is it going to be complex?
View Replies !
Where To Start
I'm still new to HTML / PHP and so forth, but here is my project. I am going to create database table with URL's in it. This table is going to be my list of "member sites". I want a user to be able to enter a search question (for Example, "GOLD WIDGETS"). Then I want to move through the list of "member sites" searching each site for "GOLD WIDGETS".
View Replies !
Where Do I Start
I don't have any idea about frameworks, how they work and what they are. I didn't learn much of the base PHP stuff, but I can assemble a quick program if I'm required to, and if it's needed I can go back to revisiting some of the php books I have. And I kinda know some xhtml/css but I won't do it without an IDE or web development tool (i.e Dreamweaver) that auto-completes and does most of the dirty work for me. from where do I need to start to get the basic knowledge and getting experience(quickly)? I need this done in about 2 months, and I hardly can keep myself motivated to do this.
View Replies !
Best Way To Start Learning...?
Alright, I need to learn PHP, but honestly I'm having trouble with some of the online tutorials for two reasons: 1. They're incredibly dry and tend to just say what things do instead of going in-depth into examples. 2. They don't provide me with excercises and projects in which to test out what I've learned. The best books I've ever read on any form of scripting, coding, programming, etc. give me tasks in which to use what I've been taught. I only learn well by doing, not simply by being presented with facts. So... is there a site and/or a book (I'm willing to buy one if necessary) that you would recommend for someone like me? As a side note, a lot of them seem to put a lot of time and effort into instructions on setting up PHP, Apache, and MySQL. I have a web host that's already fully configured (and runs PHP as CGI, although Apache is an available method that goes against their recommendation)
View Replies !
PHP Script At Start Up
I would like to run a script at startup under SuSE 9. I read and figured out that it can be done using chkconfig and setting the proper run level. The problem I have currently is that I depend on system environmental variables being available for PHP. I am using PHP as a scripting language (nothing to do with the web), and this PHP script is called from the start up bash script, but it cannot retrieve any environmental vars at runlevel 3. When are environmental vars set and at which runlevel? Or should I do this some other way?
View Replies !
Newbie Looking Where To Start
After being a lurker in here for some time, I got the PHP bug, and downloaded Apache 2.0, PHP 4.summat and MySQL I installed, registered the dll's edited the conf files and finally got it all working (i think) after a few nights of faffing about. Now... where should i start? I know naff all about PHP or MySQL and would be greatful if someone could point me in the direction of some tutorials to start learning about PHP and MySQL. I am from a programming background (visual basic) and have a welly load of knoledge on relational databases so wheres the best sources... Book/Web/Forums etc...
View Replies !
Fopen Start On New Row?
is it possible to have fopen start on new row? fopen("$filename","aw"); i've been trying to write to the end or beginning, doesn't really matter, of a .txt file, but it just writes on the same row as the last input.
View Replies !
How To Start Session?
i m learning how to have session in my form. like for example, after the user insert their information in the application form, they will then be redirected to another page. the another page is where they will have to print out their form - with their info added in. but i m unsure how to go about doing it. can someone show me?
View Replies !
When Does HTTPS Start?
This might seem obvious, but do you have to establish an https connection before a form is sent, or can you send the form to an https connection and have it encrypted? For some reason, I never looked into this - I just always sent the form to the user via https to be sure - and to be honest it really doesn't matter that much, but I'm just curious. Code:
View Replies !
Session Start More Than Once
I include sessionstart.php which calls session_start() and instantiates a user class from my index.php. I also have a place to login with the form set to run login.php and then I want to reload the index.php with the user set up. Does the session_start() get run again and if so does it kill the stored values? And how am I supposed to reload the index.php? The way it is set up now I have to have "Action='login.php'" but somewhere in login I have to go back to index. Or should I put the action="PHP_SELF" and collect the user's info on load?
View Replies !
AJAX: Where To Start
IVe read a few articles: IBM IBM IBM but im left wanting more... would it be better to get a book that provides step by step the basics-or- is there a website that would be comperable.
View Replies !
Get This Session To Start
I'm just tryin to get this session to start... in page1.php there's this: <?php session_start(); $_SESSION['test']='working' ?> and in page2.php i will do this: <?php session_start(); echo $_SESSION['test']; ?> but nothing prints.
View Replies !
Start A Session
i need a very simplified log-in / logout process for learning purposes. 1)when a log-in button is clicked i want a session to start. similarly when another button is clicked i want the session to be destroyed. this should apply acoss the whole site and not just for one particular page. 2) to know that a session is on, i want an if statement that evalutes if a seession exsist. If so, a text saying "session exsist" to show up.
View Replies !
Start MySQL
I'm running a website on XAMPP and I was able to start and stop the mysql database each time I opened the Control Panel Application. But the last time I had mysql running I clicked the Admin. button and that launched the mysql admin interface. Now, whever I click the Start button for mysql on the XAMPP Control Panel Application, the database starts for like 1 second then turns off again immediately.
View Replies !
About To Start A New Project
I am about to start writing invoicing software for our company, and think PHP is the direction I should take. Should I look at using any other framework like Cake, Pear, or anything else to aid in the process?
View Replies !
Session Start-Up
I'm trying to use sessions to store a user's username for me. I seem to be messing up the sessions_start() command. I've put this: PHP Code: <?php session_start(); ?> at the top of the body section of my page but get this message: ----------------------------- Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/www/scodut.freehostia.com/sign_in.php:10) in /home/www/scodut.freehostia.com/sign_in.php on line 10 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/www/scodut.freehostia.com/sign_in.php:10) in /home/www/scodut.freehostia.com/sign_in.php on line 10 ------------------------------
View Replies !
Php Tag To Start New Page
I have a page that is generated based on a user's selection of a state. They can then choose to use the default letter, or write a custom letter. The state they select will always return 2 people. So I need to output the letter to 2 pages for them to print out. Here is what I have so far. while ($row = mysql_fetch_array($query)) {echo "<p>",$row['first_name'], " ",$row['last_name'], "<br>", $row['address'], "<br>", $row['city'], ", ", $row['state_dc'], " ", $row['zip'], "<BR>", $row['email_address'], $row['website'], "<P>", "Dear Senator ", $row['last_name'], ",", "<P>"," $letter" ; } If the letter they put in is less then a whole page, then next senators address is on page one and there for unprintable.
View Replies !
Session Start
user logs in, passes thru auth.php if that passes $_Session is now true. on include.php i have: session_start(); include.php is on all pages. do i have to have session_start(); on any other pages to keep session active? or will include.php do it for me.
View Replies !
CGI Virgin... Where Do I Start?
I'm only familiar with HTML raw coding, and am eager to learn CGI and PHP. Is it my impression or has PHP indeed taken over Perl? I have no idea where to start. Is there an online resource that someone can lead me to? Also, I don't have access to a server that I could play with while learning the basics. Will this hinder my learning curve?
View Replies !
Start Array At 1
I am reading the contents of a folder and storeing the file names to an array as such: PHP Code: while (false !== ($filename = readdir($dh))) { $files[] = $filename; } When i print_r the values to the webpage, even though I only have 6 files in the folder, there are 8 elements in the array showing where the first 2 are empty.
View Replies !
Start With Ecommerce
I am an amateur programmer looking to build an ecommerce site, but am a relative newcomer to the tools available (e.g. PHP and MySQL). I was just wondering if any of you have any recommendations as to where I should start gaining the knowledge necessary (e.g. books and tutorials).
View Replies !
Start A New Browser
I have a simple form, and after the visitor filed the form and click the button, I want to pop up a new browser so the user can preview the information, but the original browser window is still there.
View Replies !
Start A Session On Page
im trying to start a session on my page... and it kind of works... after initializing the session, and assigning a value to that variable, when i print that variable... it prints the value, but also shows some error messages... This is my code... session_start(); session_register('userNum'); $userNum = mysql_result($res,0,"userId"); printf($userNum); These are my errors... Warning: Cannot send session cookie - headers already sent by (output started at 'examplesiteandpage':2) in 'examplesiteandpage' on line 8 Warning: Cannot send session cache limiter - headers already sent by (output started at 'examplesiteandpage':2) in 'examplesiteandpage' on line 8 Does anyone know why this happens? The variable is still created, and the value assigned... but i get the errors... thanks
View Replies !
Start And Stop Apache With PHP
Is it possible to start and stop a server using a link button. Is there any PHP function to control the server starting and stopping. I have a small function to check the server status. This is it below // This function checks to see the status of the servers function check_server($ip){ $fp = fsockopen ("$ip", 1111, $errno, $errstr, 30); if (!$fp){ echo "<td bgcolor=red><FONT face=arial, helvetica size=2 color=white>DOWN</font></td>"; } else{ echo "<td bgcolor=green><FONT face=arial, helvetica size=2 color=white>UP</font></td>"; fclose($fp); } } I now want to either have a method to either stop or start the server depending on its status.
View Replies !
Inserting At Start Of Array
I am trying to insert an item at the start of an already populated array but I cannot seem to find a way of doing it. Here is an example of what I am trying to do:
View Replies !
Start A Session Id And Register
I start a session id and register "lang", lang equals english.php I have 3 images that are links and one of them is the France flag. Now how can I make so that when a user clicks on France flag, the value of the $lang changes and becomes french.php instead of english.php ?I can't do things such as: <a href="blah.php onclick="<? php code?>"> cause this gets executed no matter what. so if the client does not click on this link, it'll get executed anyway.
View Replies !
How To Delay The Start Of A Function
My problem is that a function in the page have a rather heavy mysql query. The query takes between 6 - 10 seconds. while the query takes place other content on the page stop loading (Opera). Explorer and Firefox seems to wait for the whole page to load befor drawing the site. Is there a way to tell the browser to draw all the content except for this function and run through this at the end, alternatively to run the process in backround? This functionality a want is on many sites who let you search through multiple whois databases.
View Replies !
Record A Session's Start And End
how can i record the time a session started and ended. by ended i mean. ended in any way. browser closed, logout link clicked. or session expired. i thought to do if (session_register('var1','var2')) { // record time } but register_globals is off. can i still use that? and i still dont know how to record the ending.
View Replies !
Php Kick-start Required
Sorry to barge in like this but I'd really appreciate any pointers for a seasoned veteran of programming (including C, Java, ASP, JSP, Perl, shell, VB, HTML, XSL) who has never touched PHP before. I've rather rashly agreed to doing some enhancements on a PHP Web app and, timescales being what they are, I don't have enough time for "learn PHP in 21 days" or suchlike
View Replies !
Show Images Using A Start To End
i have a folder of images in numerical order. 45.jpg 46.jpg 47.jpg in order for me to view them i have to type in the url and see if it exists. how am i able to make start to end of images. for example if i have a form with a start and end field of 40 - 50 how can they be displayed so i only see 40.jpg to 50.jpg PHP Code:
View Replies !
Installed PHP And Now Apache Won't Start
I installed Apache 2.2.3 per the instructions in the book I'm reading 'AJAX and PHP' by Darie et al. After installation, I confirmed that the server was working. I then installed MySQL and PHP. After configuring the system per the book's instructions, I now find that the Apache server won't start.
View Replies !
Start The Session On A Sub-folder
I've got a Php 4.3.3 installation on A Red Hat Advanced Server 2.1. Sessions start correctly if i start them from the server root. But, if i start the session on a sub-folder, when i change to a folder that's not below it, the session gets started again. Let's see an example When i begin from the document root all goes as expected... Open /index.php -> session id = A Open /folder1/index.php -> session id = A Open /folder2/index.php -> session id = A But when i begin on a subfolder....... Open /folder1/index.php -> session id = A Open /folder1/index2.php -> session id = A (inside the same folder the session is mantained) Open /folder1/subfolder/index.php -> session id = A (on a sub-folder the session is also mantained) Open /folder2/index.php -> session id = B (on a folder that's not below the first, the session starts again!!!!!!!!) Open /folder3/index.php -> session id = C It's like if the session were only set for the current path and downwards, but not the entire server... Any thoughts?
View Replies !
|