Apache Httpd Log Pipe To Php
I would like to pipe my Apache log(s) to a PHP script(s) and then to mySQL. I can successfully pipe the log to a file. Mostly it appended itself to the end of the php script - so some success.
Since in the script below the log is NOT appended to the end of the same script file, may I presume that the script does not know what to do with the input?
How do I get the script to execute and accept the log entries piped from Apache? Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Installation Question Re: Apache Httpd.conf
I'm trying to configure the config file in Apache to load the PHP module, but am getting the following error: LoadModule takes two arguments, a module name and the name of a shared object file to load it from The lines I added to the config file were as follows: LoadModule php4_module c:Program FilesPHPphp4apache.dll AddModule mod_php4.c AddType application/x-httpd-php .php I have loaded the appropriate phpapache.dlls into the Apache directory where the apache exe resides, but am still not able to run the web server. If I have copied those files to the directory, do I still need to load the modules within the config file?
Can't Install PHP - Keep Getting "Invalid Directory" Error Regarding The Path To Apache Httpd.h
I've installed Apache 1.3.36 on my Redhat EL 3 machine. Now I'm trying to install PHP 5.1.4. I can not get the ./configure command to work. I keep getting this error: configure: error: Invalid Apache directory - unable to find httpd.h under /usr/local/apache/include So then I run this command: find / -name httpd.h which should find every file on my machine with the name "httpd.h". These are the results I get: /usr/local/apache/include/httpd.h /home/shelley/apache_1.3.36/src/include/httpd.h So I've rerun the ./configure command, using this first: --with-apache=/usr/local/apche/include and since that didn't work: --with-apache=/home/shelley/apache_1.3.36/src/include/httpd.h but I get the "Invalid directory" error with both addresses.
Where To Find Pipe Information?
On a Linux platform, I have the need to call a compiled 'C' program from a PHP script (to do some special authentication), and to keep the information passed from the PHP script to the compiled 'C' program secret, i.e. the information should not be passed on the command-line. The PHP pipe manipulation functions (such as popen) were suggested to me. Where can I find out more about pipes, specifically: a)How to use the C library calls to manipulate pipes? b)The Linux API (below the C library)? I need enough information to write the compiled 'C' program, to exchange information with the PHP scripts via pipes, and to handle exception conditions. I'm just not sure where to look ... I'm not even sure if the C library is documented ... and which documentation is appropriate.
Broken Pipe Error
occasionaly I find in my apache logs that fastcgi had a broken pipe error with php running as fastcgi. the logs are like this: --[color=blue] > [Wed Nov 5 18:21:31 2003] [error] [client %ip%] (32)Broken pipe: > FastCGI: comm with server /opt/guide/ppi.searchy.net/cgi-bin/php.fcgi" > aborted: write failed > [Wed Nov 5 18:21:31 2003] [error] [client %ip%] FastCGI: incomplete > headers (0 bytes) received from server > "/opt/guide/ppi.searchy.net/cgi-bin/php.fcgi"[/color] -- /opt/guide/ppi.searchy.net/cgi-bin/php.fcgi is the php binary itself. The error occure randomly and can only me reproduced to visit the site and "have luck" before an error occures (Once I had my site beat up with simulteanious wget -m's and all request where perfect, next day I view the site with my browser "ERROR!" and it suddenly occured :-S the apache config is like this: --[color=blue] > FastCgiSuexec on[/color] [color=blue] > And in a virtualhost directive: > FastCgiConfig -multiThreshold 50 -maxProcesses 50 -minProcesses 5 > -maxClassProcesses 50 -startDelay 5 -appConnTimeout 0 > -listen-queue-depth 1000 > FastCgiServer /opt/guide/ppi.searchy.net/cgi-bin/php.fcgi -processes 5 > AddHandler php-fastcgi .fphp .php4 .php3 .php > Action php-fastcgi /cgi-bin/php.fcgi[/color] -- php ignores it as a bug report :-/ When I run php as an external fastcgi application the broken pipe errors seem to seaze, but webpages are slowing down. At the moment I'm running PHP4.3.4RC3 on FreeBSD 4.8
Pipe Incoming Mail To PHP Script
Does anyone know how to pipe all incoming email to a PHP script? Like if I have the domain test.com, and an email was sent to blah@test.com, that email would get directed to a PHP script where I can handle all the content of the email. Specifically I want to add the email info into a database for later use.
Problems While Exporting Data Using Pipe Symbols
I am facing problems while trying to export data into pipe format. In fact I am fetching records from mysql database and then trying to create a text file ( using pipe as delimeter) , intending to open in Excel. The data is been inserted from textarea fields, where the user can write text and may press enter key to format his text accordingly. Now when the data entered into the database it keeps some unidentified value so as to keep the formatting. Hence while displaying the text file I find that lines are seperated according to the format user gave. Thus creating the problem while opening up in the excel file. example:
Importing To DB From Pipe Delimited Text File
I am trying to make a PHP script that will import data from a pipe delimited text file in to a database. The problem I am having is that the fields have long descriptions in them and there are multiple line breaks for paragraphs. They contain HTML codes as well (<B>). The multiple line breaks are causing it to import the data strange, putting data in the wrong fields and totally missing some data as well. Here is what the text file Code:
Importing A Flat Pipe Delimited File Into A MySQL Data Table
I have done this in perl but eeew I don't want to use perl anymore. I want to be able to take a flat file that looks like this: mbriones@...|Marian|Briones bobsmith@...|Bob|Smith janedoe@...|Jane|Doe (etc) The table has more than 3 fields, so I'd want to process the flat file and then do an INSERT into mailinglist SET field=$value for each line. Does someone have a nice way for me to do this? The flat file will be uploaded to the server via a form (copy) and then be processed.
Httpd.inc Configuration.
I have installed php apache and mysql all otgether not while ago, and i test them and theyr working fine. I also forwarded my domain name to it and everything. 1. when I am typing my domain.com/phpMyAdmin it just take mes to the phpmyadmin, without asking me a log in. 2. I have read all about apache and everything and how it can not be secure sometimes and ppl can get to your httdocs. so my question is how can I configure apache or that httpd file so no one else except me can access those directories? 3. and another question is, is there a way to install PERL on apache?
Httpd Refferer?
I'm not sure if that is what I have to use to accomplish this, but I want to make it so nobody can view a certain page unless they have been to a page that is first requested. For example, say I have login.php, and administrator.php. They cannot go into administrator.php without first going to login.php. How can this be done?
Httpd Allow Overide?
I am in the httpd file in the Apache folder and need to change the part that says AllowOverride from None to All, so that when I create a ..htaccess file it wont ignore it. However in the httpd file there are a few different sections where it has found the AllowOverride code. Do I change all of these sections below or just one of them? - - - <Directory /> Options FollowSymLinks AllowOverride All </Directory> - - - # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All - - - Alias /icons/ "C:/ApacheGroup/Apache2/icons/" <Directory "C:/ApacheGroup/Apache2/icons"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> - - - AliasMatch ^/manual(?:/(?:de|en|fr|ja|ko|ru))?(/.*)?$ "C:/ApacheGroup/Apache2/manual$1" <Directory "C:/ApacheGroup/Apache2/manual"> Options Indexes AllowOverride None Order allow,deny Allow from all <Files *.html> SetHandler type-map </Files>
PHP, WML And .htaccess/httpd.conf ???
Researching development of a WAP site using WML and PHP. However, I may not necessarily want _all_ of my .wml pages to be PHP-enabled, just normal wml. Therefore, I need the Apache server to recognize multiple file extensions. This is what I'm trying within .htaccess, but it does _not_ work. HELP!!! # MIME Types for WAP # For PHP 3.x, use this: AddType application/x-httpd-php3 .php3 .wml # For normal WML pages. AddType text/vnd.wap.wml .wml # End MIME Types for WAP
Starting & Stopping Httpd
What i want to do is to fire the functions in the httpd script to start, stop, restart, httpd for eg. from the console i would write ( from the init.d dir.) httpd start. to start the Apache server. but how do i do it from a php script? I can open it with fopen().
AddType Application/x-httpd-php .php
I have mediawiki installed, amd mod_php5 installed. I upgraded to Apache 2.0. When I request a wiki page, the server returns the code of the php page. Relevant lines from httpd.conf: LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php
Can I Restart Httpd From A Php Script?
I have made a solution where a user is added to the system and a folder is set up for him. In order to make the folder webDAV accessible for him I have to add some lines to the current httpd.conf file and restart the webserver. Is this possible to do from my php script - or even advisable? I could envision an alternative where i would make a cron job restart httpd every 15 minutes or so, but i would prefer the first method. Is this possible?
AddType Application/x-httpd-php .htm
I want to parse some .htm files in a subdirectory as php. To do this I made a .htaccess with online the line: AddType application/x-httpd-php .htm in it and uploaded it to the directory with the files I want to parse as php in. If I now open one of the files it does not parse the file as php instead a window opens telling me a Download-Window opens asking me if I want to save the file on my HDD or if I want to open it with some application. I got this thing to work some weeks ago but by incident I deleted the .htaccess and with the new one it doesn't work.
Php_admin_value(s) In A Httpd.conf File
This is something that is rather confusing so maybe someone here can shed some light. I have a web server that has multiple httpd.conf files running. Why you ask? Simple answer - for better site customization on a per site instance. Since I have several sites that end users administer to vs. myself, I want to make the safe_mode option a local setting vs. a Global setting. Obviously this is more for server security than anything else. I myself would use the setttings in the php.ini file. Now here is the issue - When using the "php_admin value" to set safe_mode On it does not show up as being set using the <? php_info() ?> tag. It says that safe_mode is set to Off in both the Local and Global settings. What could be the reason for this? Or is it just not being reportred properly. I have set the safe_mode setting as both a Virtual Server and stand alone. currently here is what I have set. <VirtualHost yoursite.com> ServerName yoursite.com DocumentRoot /path/to/site/files php_admin_value safe_mode On php_admin_value safe_mode_gid On </VirtualHost> Is there something missing that I need for this to work properly? Thanks. PHP Server 4.2.3 Apache 1.3.27 Solaris 8
Suspended Site - Httpd Overloading
I got a really big problem. My host yesterday suspended my site, telling me that my website is doing something, called httpd overloading. This is the report, thay provided me:
AddType Application/x-httpd.php .html .php .htm
I have a site which runs php on nearly every page because of an announcements function. This is is a site on Apache and *nix. It seems to me that on a site like this it would make sense to add the line: AddType application/x-httpd.php .html .php .htm to my htaccess file so that I could call all of the main files with the html ending (that's the page files, not the the includes on those pages). First, did I get this right? I'm looking at a thread here: http://www.webmasterworld.com/forum88/148.htm?highlight=parse+.php+files I'm guessing that this will cause a performance hit whenever a straight html file is called and php tries to parse it first. It also seems to me that the .html will be a bit less secure, since the code may then be accessible. That leads me to think I should keep the main chunks of code as includes in files named *.php. Are there other costs or benefits? Anything related to SEO that I need to think about?
AddType Application/x-httpd-php Htm Html
I know that you can use the following code in .htaccess to execute .html pages as PHP: AddType application/x-httpd-php htm html But, is there a code that can be used to accomplish running a single .html page as php instead of the above code that runs every page on the site as php? I know that I could just change the .html to .php, but I really want to know if I can run a single .html page as php without changing the extension and without using the (AddType application/x-httpd-php htm html) code that will run all of my .html pages as php.
LoadModule & AddModule In Httpd.conf
I would like to know what is the difference between LoadModule & AddModule configuration directives in httpd.conf of Apache server. I guess LoadModule is for loading dynamic modules which or in object file and the later is to load dynamic modules which are in source form like c source file. Is that right.
PHP Installation And @sbindir@/httpd Error Message
Installing PHP 4.3.6 on a i386 platform w/ FreeBSD 4.9 O/S installed and running apache_1.3.31 make with ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs --enable-versioning ===> ......... Configuring SAPI modules checking for AOLserver support... no checking for Apache 1.x module support via DSO through APXS... Sorry, I was not able to successfully run APXS. Possible reasons: 1. Perl is not installed; 2. Apache was not compiled with DSO support (--enable-module=so); 3. 'apxs' is not in your path. Try to use --with-apxs=/path/to/apxs The output of /usr/local/apache/bin/apxs follows apxs:Error: @sbindir@/httpd not found or not executable configure: error: Aborting ......... Perl is installed perl -v This is perl, v5.8.2 httpd -l Compiled-in modules: http_core.c ........ ........ mod_so.c mod_setenvif.c mod_ssl.cmodule apxs is installed version ( not from source tarball) ls -l /usr/local/apache/bin/apxs -rwxr-xr-x 1 root wheel 24624 Jun 21 01:23 /usr/local/apache/bin/apxs* and is executible could not interpret the error message : @sbindir@/httpd not found or not executable
Sending Mail In Omni HTTPd With Mail()
Whenever I try and use the mail function I get a "Failed to Connect" error. I'm running PHP4.0, Omni Httpd 2.06 on Win98. Is there something else I have to do to enable email? I know if worked before on PWS, but I switched because I couldn't get PHP4 to run under PWS. Any help is greatly appreciated.
Apache 2.0 And Php
I was wondering if anyone has had any luck getting php to compile and work with apache 2.0. i use apache tool box to compile it but they dont have support for it yet. if anyone has compiled and tested it with the previouse beta's or rc's any info would be awesome!!!
CGI Vs Apache
Is there any difference on how PHP is wrote based on the server type? I have been using PHP on an Apache module and I just started using a CGI module but I am getting a lot of errors, mainly "Variable undefined" and when I tried to add records to a MYSQL database, I received this error: "CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers.
Php 4.2.0 And Apache 1.3.24
Why can't I run apps like phpnuke, postnuke, xoops, phpwebsite, etc.? I have tried them all seriously and always get the same effects. When I try to install either of them the pages never change even with register_globals On. Was I suppose to upgrade apache to 2.0.35 for compatibility issues?
Apache
Has anybody wrote a script or coded anything to set php up on apache running on windows.
Php 5.04 With Apache 2.0.54
I can build php 5.04 with apache 1.33 statically with the apache configuration option: --activate-module=src/modules/php5 How can I build php 5.04 with apache 2.0.54 statically? It seems that the information I have only shows how to build php as a dynamical module of apache.
PHP And Apache 2.0
I am installing Apache 2.0 with PHP. On top of PHP I plan on installing netjuke. I am having problems and have a strange issue: the following works: <? phpinfo(); ?> but the following does not worl. the source code appears on the page as if it is not being processed. <?php phpinfo(); ?>
Apache In Win Xp
I already installed Apache, Mysql and PHP (last version for each one) into my system running Win Xp. “All running ok” When I run scrip “A” my data lost; it didn’t print. Code:
Php & Apache
Just wonder if there are any sites with a guide on how to set up apache and php on windows XP. Would like to test my php-pages locally.
Apache + PHP
I have installed Apache apache_2.0.52-win32-x86-no_ssl.msi and PHP php-4.3.10-Win32 on windows 2000 professional . I also get success in installeing both of them , but when i am trying to run apache C:/localhost on my mozilla or internet explorer browser , i am not able to get the default page, i don't know why its not working. I am a new learner of PHP and for the learning process i want to download it as soon as possible.
Anyone Using HP-UX With Apache, PHP And OCI?
I'm searching for someone who's using HP-UX 11.x with Apache and PHP with the OCI8 extension (for accessing Oracle). I'm having some issues while running this and would like to exchange some information. my environment is: HP-UX 11.11 Apache/2.0.49 from the hpuxwsApache package PHP 4.3.4 as included in that package OCI8 as included in that package (I also tried Apache 2.0.52 with PHP 4.3.8 but that didn't make a difference) when I'm enabling OCI8, Apache works fine, but the commandline PHP fails (and I need that as I have background processes, generating some reports). The error is: PHP Warning: Unknown(): Unable to load dynamic library '/opt/hpws/apache/php/lib/php/extensions/oci8.sl' - Can't find path for shared library: libclntsh.sl.8.0 in Unknown on line 0 after finding http://bugs.php.net/bug.php?id=13151 I managed to solve this by setting: export LD_PRELOAD=$ORACLE_HOME/JRE/lib/PA_RISC/native_threads/libjava.sl and now also PHP from the commandline works fine as well. but I've no clue if this is a good solution or there's a better way. but now I'm running into an issue with LDAP: ldap_bind() fails from a PHP script run from the commandline, while exactly the same code works perfectly fine through Apache - and it also works fine from the commandline when removing the LD_PRELOAD setting - but that removes the OCI8 functionality again... so I'm feeling stuck having the choice between LDAP and OCI8 - but my scripts uses both... (FUP to comp.sys.hp.hpux)
Apache For Win
Can any one tellme how to configure Apache on win nt to run PHP i already have PHP running on IIS.
Apache 2.0.48 And PHP 4.3.4?
I'm currently running Apache 1.3.27 on Debian Woody with a PHP backport (version 4.3.4), together with Apache-SSL 1.3.27. I have been considering upgrading to Apache 2.0.48 which I now believe is recommended for production. However what is the status of the interoperability with PHP? I have read on the PHP site that it is not recommended to run Apache 2.0 with PHP but does this refer to the latest revisions or the initial release?
Help With PHP And APACHE
I'm using PHP and Apache. How do you configure Apache so that it allows the use of php and session data. I get the following error: Warning: session_start(): open(/tmpsess_ed0b0c6b9b2d32d64172373bd8a6bcaf, O_RDWR) failed: No such file or directory (2) in c:orcl_asapacheapachehtdocsforumuserauth.php on line 5 On my php.ini file, i specifiy that location of for the session data to session.save_path = "C:/temp"
PHP And Apache
I am trying to set up a Web site I am building so that it works like this: When someone goes to: www.runningback.com/reg The "reg" get's passed into index.php as an argument and index.php is executed. I can pick up "reg" in index.php using $_SERVER['PATH_INFO']. But right now what happens is the url is not recognized by Apache 1.3 and so gives me an error. If I call www.runningback.com it calls index.php just fine, but not when I want to pass in an augument. I'm trying to make user friendly urls.
Apache 1.3 + PHP 4.x + SSL
I've never implemented a secure server before - and I now have a project for it - It will be an Apache 1.3 environment tuned with PHP and MySQL - and I'd appreciate any comments/advice/note from folk who have done similar. I have my application working fine in a non-SSL environment and believe the switch-over should not be too difficult. But... Can someone confirm the following: My LAMP (Linux, Apache, MySQL and PHP) sit all on the same server - I only require SSL between client and server therefore I believe I do not need to tune PHP/MySQL - true/false? I have the following modules compiled in my Apache httpd Compiled-in modules: http_core.c mod_vhost_alias.c mod_env.c mod_log_config.c mod_mime.c mod_negotiation.c mod_include.c mod_dir.c mod_cgi.c mod_actions.c mod_alias.c mod_access.c mod_auth.c mod_unique_id.c mod_so.c mod_setenvif.c mod_ssl.c mod_php4.c suexec: enabled; valid wrapper /opt/apache/bin/suexec I believe I have everything I need already compiled in - true/false? Is it sufficient for me just to edit the my httpd.conf file under the heading 'SSL Virtual Host Context' and tune accordingly? Since my server sits behind an external firewall, and since the only services will be ssh and apache listening, would one consider that reasonably secure? Can anyone recommend any other steps I might consider? Since Apache/PHP sit on the same server as MySQL I plan on having them use sockets (pipes?) and not tcp/ip port 3306 - I've not done this before either but believe it gives added security and performance benifits -
PHP & Apache
I am having problems getting PHP and Apache to "talk" with one another. Does anyone know of a good website that can show me how to get this done without a lot of pain?
Apache
I'm installing Apache for the first time on my home machine, XP Pro. Of course, the very first screen has me "Lost." It asks for my network domain and network servername. How do I go about finding what the network domain and network servername are for my machine?
Php Apache
I tried to run php with Apache in windows. But Apache doesn't recognize the PHP file and returns an alert box to save a file. i knew that i need to have a line AddType application/x-httpd-php. php in httpd.conf under conf directory or apache installed directory. But this doesn't work.
Php4ts.dll And Apache?
I've installed Apache 2.0.46 on a win98se machine and then tried to install php as a module. I unzipped php 4.3.2 to c:program filesphp, moved a php.ini file to c:windows and edited the directories, then moved php4ts.dll to the sapi folder. When I tried to start Apache after configuring httpd.conf, it could not find a library file (i assume the php4ts.dll file that i placed in the sapi folder). So then I moved php4ts.dll to c:windows and Apache started. What confuses me is why the file could not be found. I installed php and apache the same way on a winxp pro machine and it found the file in the sapi folder without any problems. Why would it not be found? It's not really a problem, but it bugs me why it would not work. Could it be a difference in the Apache installation between the two operating systems? Thanks in advance for the info.
PHP Not Available On Apache (Linux)
I am a newbie to Linux, and therefore having a difficult time of installations that are probably quite mundane to "high-timers." I hope this is the correct newsgroup for a posting like this, but if not, please suggest other newsgroups. I have installed PHP4 on a LInux/Mandrake machine, running Apache 1.3.12. All installations are compiled and installed in the default locations. In the browser, I see a text printout of the .php document I'm requesting, rather than the executed form. File types of: AddType application/x-httpd-php .php3 .php4 AddType application/x-httpd-php-source .phps have been added to the Apache config file. I have a list of what PHP was compiled with, and --disable-short-tags was not one of them. Execute permissions (755) have been added to the files I'm trying to see. The INSTALL file called for mod_so which would be visible if httpd -l was run. It was. The five steps required in the "Quick Install" went through without a problem. Actually, I'm just trying to execute that tiny .php file that they give you... <?phpinfo()?> . I've done the copying thing: cp php.ini-dist /usr/local/lib/php.ini In the INSTALL file, it calls for LoadModule php4_module libexec/libphp4.so to have an entry in Apache's config file. I don't see one. I also did a search for the libphp4.so file, and there's none to be found. A search for libphp4 shows a number of files, but none with .so extension. This PHP installation was performed from a php-4.01pl2.tar.gz download - is this the right module? As a note, CGI forms and MySQL queries work fine on this machine.
Cookies & Apache & PHP & W2K
This below is my simple source to set a cookie: <? setcookie('geinig', 'banaan'); ?> Though it doesn't set the cookie, can't find it in my directory cookies, below is an advanced example I pulled from devshed: <? // set cookie if not already set if (!isset($id)) { srand((double)microtime()*1000000); $randval = rand(); setcookie("id",$randval,1003842401,"/","localhost",0); } setcookie("id",$randval,1003842401,"/","localhost",0); // a cookie to expire for 4 hours -> time()+14400 ?> But I can't get any values, perhaps because the cookie isn't set. Used the below code to get the code: (used various codes though) <? echo $HTTP_COOKIE_VARS["id"]; ?> Any help would be much appreciated!
Apache Restart In Php
Im using apache 2.0.44 and php 4.3.0 on a linux machine. I want to restart apache by using exec() or passthru() in php, but it wont work. If a script in my working folder starts with #!/.../php -q it is possible to restart apache by ./script.php, as root, by using exec() in this script. But if I do it on browser, by executing the same script by exec(script.php), I get: (98)Address already in use: make_sock: could not bind to no listening sockets available, shutting down unable to open logs I changed the mode of the logfiles on 666, but thats not the answer. So, if anyone understands my broken english, is it possible to restart apache by using a running apache? Or, is there a possibility to run another instance of apache under Linux?
|