-
How To Run PHP in HTML Pages
Date: 07/29/06
(Java Web) Keywords: php, html, apache
This technique will only work if your Apache server has PHP enabled (how to test php support in apache http server) and .htaccess enabled.
In the root directory of your html files create a file named .htaccess. The file may already be present.
Open the file in your favorite editor and add the following lines:
addtype application/x-httpd-php [...]
Source: http://blog.taragana.com/index.php/archive/how-to-run-php-in-html-pages/
-
Dreamweaver setup/work arounds
Date: 08/16/06
(Web Development) Keywords: html, hosting, apache
This is how I have my apache setup for virtual hosting on a win32 box.
d:/httpRoot/lc.clientSite.com/
with
d:/httpRoot/lc.clientSite.com/public_html/ being the actual http doc root.
is there a way I can tell dreamweaver my doc root is
d:/httpRoot/lc.clientSite.com/ while still being able to press F12 and get http://lc.clientSite.com/ instead of http://lc.clientSite.com/public_html/ which translates out to d:/httpRoot/lc.clientSite.com/public_html/public_html/ which is wrong.
The reason I want to see below the root is so I can stay in Dreamweaver and be able to edit the secureScripts dir and read my log entries.
Source: http://community.livejournal.com/webdev/346156.html
-
One apache server, one document root per virtual host, multiple/conditional PHP environments
Date: 09/05/06
(PHP Community) Keywords: php, html, web, apache
This is a very simple trick I came up with for my test environment at home. It's used with Apache 2.* with the virtual host module loaded in httpd.conf and a virtualhost.conf file included at the end.
The trick is this:
Say you have your virtual host sites in this directory structure.
/websites/users/myDomain.com/public_html/
At
/websites/
create two junctions/links to /websites/users/
/websites/php4 -> /websites/users/
/websites/php5 -> /websites/users/
Now use the following conf file.
ScriptAlias /php4/ "d:/wamp/php4/"
ScriptAlias /php5/ "d:/wamp/php5/"
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
#Tell php where to find INI settings
SetEnv PHPRC "d:/wamp/php4"
#Tell Apache to process this mime with this CGI parser
Action application/x-httpd-php "/php4/php.exe"
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
#Tell php where to find INI settings
SetEnv PHPRC "d:/wamp/php5"
#Tell Apache to process this mime files with this CGI parser
Action application/x-httpd-php "/php5/php-cgi.exe"
#Tell's apache files of this type are php mime type
AddType application/x-httpd-php .php .phtml .php3
#if a broswer calls the server with http://php(4||5).myDomain.com it parses out to
#d:/website/php(4||5)/myDomain.com/public_html/
VirtualDocumentRoot "d:/website/%1/%2/public_html/"
So now when you setup your hosts or local DNS server, you can run the same website/application in either environment by
changing out the subdomain. And further more, there is no way to mistake what environment your in or the need to have multiple copies of websites.
Best of all, you can make other junction/links and Directory statements in Apache so you could test your site on just about every version of PHP there is.
So
http://php4.myWebsite.com/ would run the website with php4
http://php5.myWebsite.com/ would run the website with php5
I tested this out on XP 64, but because the idea is universal, it should work on *nix environments as well. I made a project log of setting this up along with phpDocumentor and subversion, so if anyone is interested just contact me.
Source: http://community.livejournal.com/php/491339.html
-
One apache server, one document root per virtual host, multiple/conditional PHP environments
Date: 09/05/06
(Apache) Keywords: php, html, web, apache
Note: Cross-Posted to php
This is a very simple trick I came up with for my test environment at home. It's used with Apache 2.* with the virtual host module loaded in httpd.conf and a virtualhost.conf file included at the end.
The trick is this:
Say you have your virtual host sites in this directory structure.
/websites/users/myDomain.com/public_html/
At
/websites/
create two junctions/links to /websites/users/
/websites/php4 -> /websites/users/
/websites/php5 -> /websites/users/
Now use the following conf file.
ScriptAlias /php4/ "d:/wamp/php4/"
ScriptAlias /php5/ "d:/wamp/php5/"
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
#Tell php where to find INI settings
SetEnv PHPRC "d:/wamp/php4"
#Tell Apache to process this mime with this CGI parser
Action application/x-httpd-php "/php4/php.exe"
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
#Tell php where to find INI settings
SetEnv PHPRC "d:/wamp/php5"
#Tell Apache to process this mime files with this CGI parser
Action application/x-httpd-php "/php5/php-cgi.exe"
#Tell's apache files of this type are php mime type
AddType application/x-httpd-php .php .phtml .php3
#if a broswer calls the server with http://php(4||5).myDomain.com it parses out to
#d:/website/php(4||5)/myDomain.com/public_html/
VirtualDocumentRoot "d:/website/%1/%2+/public_html/"
So now when you setup your hosts or local DNS server, you can run the same website/application in either environment by
changing out the subdomain. And further more, there is no way to mistake what environment your in or the need to have multiple copies of websites.
Best of all, you can make other junction/links and Directory statements in Apache so you could test your site on just about every version of PHP there is.
So
http://php4.myWebsite.com/ would run the website with php4
http://php5.myWebsite.com/ would run the website with php5
I tested this out on XP 64, but because the idea is universal, it should work on *nix environments as well. I made a project log of setting this up along with phpDocumentor and subversion, so if anyone is interested just contact me.
Source: http://community.livejournal.com/apache/34417.html
-
Thoughts on Professional PHP Development
Date: 09/22/06
(Java Web) Keywords: php, mysql, sql, linux, apache
I have started developing an interesting PHP application for LAMP (Linux-Apache-MySQL-PHP) stack. I have to say it has been an wonderful experience so far.
It is rather simple (really simple) and easy to setup little frameworks (read utility functions in a file) in php for your tasks. PHP has a delicious array of functionalities to use. [...]
Source: http://blog.taragana.com/index.php/archive/thoughts-on-professional-php-development/
-
How To Configure PHP 5 With Apache 2 On Windows in 2 Minutes
Date: 09/25/06
(Java Web) Keywords: apache
I am assuming that you have downloaded and installed Apache 2.x on your windows machine. Use the latest version 2.2, if you do not have plans to run Subversion on it. Otherwise choose Apache 2.0.x. Install it with the defaults. You may want to however changes the drive on which it is installed. Anyway so [...]
Source: http://blog.taragana.com/index.php/archive/how-to-configure-php-5-with-apache-2-on-windows-in-2-minutes/
-
Form Help
Date: 09/26/06
(WebDesign) Keywords: css, html, java, web, hosting, apache
Hi... i'm trying to figure out how to make a simple server side web application. I was wondering if someone know a good site that can help me figure out what i need to do or learn to do.
Basically i thought of something clever i wanted to incorporate into a myspace friends/add function. Basically redirect them to another page instead of the norm "click to add" function. Then make them check off a couple items, then IF all the check boxes were "true" then after hitting submit, it performed the normal add function.
If you're going to say some troll statement about how you don't like myspace... please don't bother. I'm not asking for critique on what i'm doing, i just want to learn how to something.
I've read the oriely HTML/CSS book, have a good understanding of webhosting and some apache but i've never done any web programs/applications.
If there is a good book out there that can help with these on a begineer level let me know, i really haven't found anything. The Java books are a little well... dry to read without actucally being around ac omputer to do the examples.
Something like this: (adding a text field -> output to a text file (csv) would be cool.) Sites with free basic customizable code would be good too. I saw the links in the user info on the community but got a little overwhemled on what i needed.
input 1(check box)
input 2(check box)
input 3(check box)
Submit
app decides whether all are true (and's all inputs).
If false gives some error page
if true, links just the add link for my page (just redirects to some page is easy enough)
Source: http://community.livejournal.com/webdesign/1167678.html
-
Shoutcast
Date: 09/29/06
(PHP Community) Keywords: php, security, web, apache
I'm running a Shoutcast server and attempting to enqueue MP3's to Winamp through a web interface. Is there any reason I can't do this command in PHP?
exec('winamp /ADD "'.$row[0].'"'));
It's a Windows XP Pro box running Apache and PHP5. Winamp is in the system path, and $row[0] equals something like D:\Music\Music\Ace of Base\Ace of Base - Beautiful Life.mp3.
I'm hesistant to use exec or system commands at all because of obvious security flaws, which leads me to wonder if PHP disables functionality through exec by default? I can't think of any other feasible ways to do this without slamming the CPU on my crappy little dev server. Any suggestions?
Source: http://community.livejournal.com/php/498344.html
-
Delegating authentication and authorization to the server host
Date: 10/12/06
(Apache) Keywords: apache
Suppose I am running an Apache server with SSL, and I want to delegate authentication and authorization to the host OS in the following fashion:
(1) First, try to access the requested file as the default user (e.g., www-data).
(2) If that doesn't work, use PAM to authenticate, and then setuid to the appropriate user, setgid to the appropriate group, and try to access the requested file that way.
From the documentation it appears that the parts exist (suExec and mod_auth_pam), but it looks impossible to do the whole (short of writing my own module, of course), and my attempts at Googling didn't turn up anything useful.
Does anyone know whether this can be done with existing tools, and if so how? (Or if not, whether anyone is already working on such a project and would like some help?)
Source: http://community.livejournal.com/apache/34585.html
-
Configuring Apache to Execute Perl scripts
Date: 10/17/06
(Apache) Keywords: linux, apache
Hi,
I have to work with both to configure an Apache server to execute Perl and/or CGI scripts. I browsed through the Apache.org for some info but maybe it's not there or mabe being a novice I'm not getting it.
I'm using Suse Linux 9.3 at the command line. So that's the extra difficulty.
The server is set up but when I type the address of a Perl file, it simply decides to show me the code, as opposed to executing it.
Have you ever had to configure Apache using Linux from the command line? If yes, would you offer me a piece of your advice?
THANKS!
Source: http://community.livejournal.com/apache/34816.html
-
How To Enable Nice Friendly URL in Vanilla Forum
Date: 10/23/06
(Java Web) Keywords: php, web, apache
Open up conf/settings.php and add this line:
$Configuration[’URL_BUILDING_METHOD’] = ‘mod_rewrite’;
Believe me, that’s all you need to do. Ain’t that easy?
Note: I am assuming that you are using Apache HTTPD Web Server with mod_rewrite enabled.
Note 2: I have tested it on windows but I have all reasons to believe that it will work fine on Unix / [...]
Source: http://blog.taragana.com/index.php/archive/how-to-enable-nice-friendly-url-in-vanilla-forum/
-
How To Enable / Use .htaccess / Nice permalinks in Apache Web Server on Windows
Date: 10/23/06
(Java Web) Keywords: php, software, web, linux, apache
.htaccess is a web server directive file populalrly used in Apache Web Server in Linux / Unix environment. In windows environment there is a simple way to enable and use .htaccess. Additionally it allows you to create nice permalinks for software like WordPress or phpBB.
To use .htaccess you need to enable mod_rewrite. Even with that [...]
Source: http://blog.taragana.com/index.php/archive/how-to-enable-use-htaccess-nice-permalinks-in-apache-web-server-on-windows/
-
Apache2 + PHP server problems
Date: 10/23/06
(PHP Community) Keywords: php, html, apache
I'm having a weird problem with my Windows Apache 2 server. (Apache 2.0.56) I'm running PHP 5.1.6.
As of a couple days ago, it suddenly started taking about 20-30 seconds to execute a PHP script (even just phpinfo();) Plain HTML documents on the server run just fine, and the CLI version runs fine too. It's not giving off any errors, either, it seems.
Does anyone know what might be wrong? I reinstalled both Apache and PHP and can't think of any changes to my system that occoured between when it was running fine and now.
Thanks.
Source: http://community.livejournal.com/php/505215.html
-
w2box or something like it
Date: 11/10/06
(PHP Community) Keywords: html, web, linux, apache
I created a script a while ago that allowed users to upload files to a folder and then update the html page to show the new file and the description given via a form. The users now want to be able to delete items that they uploaded. Naturally this is months after I worked on the script and they want it done today (dammit).
I found a rather nice tool in w2box:
http://labs.beffa.org/w2box/
except I can not get it to work on my server for some reason. Has anyone worked with it? The creators have not responded to my ask for help yet. Is there another script out on the interwebs that allows for file upload, deletion and downloading that is easy to deal with on a Linux/Apache server?
Source: http://community.livejournal.com/php/509439.html
-
w2box or something like it
Date: 11/10/06
(Web Development) Keywords: html, web, linux, apache
I created a script a while ago that allowed users to upload files to a folder and then update the html page to show the new file and the description given via a form. The users now want to be able to delete items that they uploaded. Naturally this is months after I worked on the script and they want it done today (dammit).
I found a rather nice tool in w2box:
http://labs.beffa.org/w2box/
except I can not get it to work on my server for some reason. Has anyone worked with it? The creators have not responded to my ask for help yet. Is there another script out on the interwebs that allows for file upload, deletion and downloading that is easy to deal with on a Linux/Apache server?
Source: http://community.livejournal.com/webdev/368139.html
-
php не интерпретируется
Date: 11/13/06
(Apache) Keywords: php, linux, apache
Настраиваю сервер Apache под Gentoo Linux. Поставил вручную php (emerge не сработало). На сервере команды типа php [file] выполняются, а вот в браузере нет.
Пытался прописывать AddType и Action, тогда говорит, что
The requested URL /usr/local/bin/php/index.php was not found on this server.
Интерпретатор здесь /usr/local/bin/php
Source: http://community.livejournal.com/apache/35247.html
-
New to PEAR
Date: 11/22/06
(PHP Development) Keywords: php, mysql, software, sql, apache
Hi all
am Pretty new to using PEAR, facing some pbms here lately ,
I ve installed pear with the following setup : windows /apache 2/mysql /php5
now while execute the following code :
require_once('DB.php');
$db_host='localhost';
$db_database='somedb';
$db_username='someuser';
$db_password='somepwd';
$query='select * from employee';
$dsn = "mysql://$db_username:$db_password@@db_host/$db_database";
/$db = DB::connect($dsn);
?>
I am getting the following error :
"Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pear.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='C:\PHP\pear') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pear.php on line 3"
please let me know how to fix this.thx alot.
Praveen.
Source: http://community.livejournal.com/php_dev/74476.html
-
New to PEAR
Date: 11/22/06
(PHP Community) Keywords: php, mysql, software, sql, apache
Hi all
am Pretty new to using PEAR, facing some pbms here lately ,
I ve installed pear with the following setup : windows /apache 2/mysql /php5
now while execute the following code :
require_once('DB.php');
$db_host='localhost';
$db_database='somedb';
$db_username='someuser';
$db_password='somepwd';
$query='select * from employee';
$dsn = "mysql://$db_username:$db_password@@db_host/$db_database";
/$db = DB::connect($dsn);
?>
I am getting the following error :
"Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pear.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='C:\PHP\pear') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pear.php on line 3"
please let me know how to fix this.thx alot.
Praveen.
Source: http://community.livejournal.com/php/513026.html
-
Will turning on SSL affect my scripts?
Date: 11/23/06
(PHP Development) Keywords: php, web, apache
Hello,
I've got a website that I developed in PHP and it connects to an oracle db. I'm running it in an environment with Apache Tomcat....
My question is, if I activate SSL for Tomcat...will this affect the scripts I've already written? In other words, will I have to rewrite my scripts in order to have the site run properly with SSL? Or does turning on the SSL do nothing to my code...
Cheers,
Mags
Source: http://community.livejournal.com/php_dev/74712.html
-
file upload error
Date: 11/24/06
(PHP Community) Keywords: php, html, apache
I'm uploading some images using the following code as a part of the catch and validate system
$image_details = getimagesize($_FILES['userfile']['tmp_name']);
// Reject upload if the file isn't an image.
if (!file_exists($_FILES['userfile']['tmp_name']))
{
$text = "the file vanished!";
}
elseif (!$image_details)
{
$text = "that file wasn't an image";
}
Testing the system with some jpeg images, one of them goes through fine while the other one reports that it's vanished. They're both under the upload limits of the html and php.ini and it's the smaller one that vanishes. I've even tried resizing and saving the images, but it doesn't change things.
Anyone any idea what's happening?
Just in case it's relevant (which I doubt) this is the one that works and this is the one that doesn't. Working with PHP 5.1.4/ Apache 2 on win2000 and Centos boxes
Source: http://community.livejournal.com/php/514268.html