-
Somthing of an apache newb.
Date: 07/28/05
(Apache) Keywords: apache
I've been running an apache server for almost a year now, when suddenly recently I noticed my server was innaccessable. After trying a few basic "kick it" techniques (restarting and such.) I decided to just shut the whole thing down and reboot it. This is what I get:
______
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted. : make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Note the errors or messages above, and press the key to exit. 26...
______
So what I figure is that perhaps somthing else is serving using port 80, I thought I knew what this was, but upon uninstall of that program the problem persists.
If anybody has any sugguestions, please post them.
Source: http://www.livejournal.com/community/apache/23549.html
-
WebDAV, DeltaV, Apache Slide Resources and Guides
Date: 08/02/05
(Java Web) Keywords: web, apache
This is a brief compilation of essential resources for those venturing in the world of WebDAV, DeltaV and Slide.
Apache Slide
Slide is a noteworthy, yet often forgotten, project which provides WebDAV Server and client implementation along with Delta-V support.
For the uninitiated WebDAV allows hierarchical resource access (like your file system) over HTTP protocol. In short [...]
Source: http://blog.taragana.com/index.php/archive/webdav-deltav-apache-slide-resources-and-guides/
-
InnoDB
Date: 08/05/05
(MySQL Communtiy) Keywords: php, mysql, sql, web, apache
hey guys, me again -
i've got mysql 4.1.13a-nt running on win xp pro (apache and php4 as well, shouldn't be relevant tho) and I'm trying to set up and use InnoDB (for the foreign keys) - whenever I make a new table in EMS MySQL Manager or through the command-line utility and try to set it as InnoDB, when the table appears, it's always MyISAM
I'm sure my MySQL Manager version supports InnoDB since it works when I create an InnoDB table on my webhost, it's only not working locally
I did the InnoDB config on install of MySQL - is there anything else I have to set or enable to use InnoDB?
Source: http://www.livejournal.com/community/mysql/65658.html
-
HTTPS on Redundant Servers
Date: 08/10/05
(Apache) Keywords: web, linux, apache
[Cross posted to apache, httpd, linux]
I've been given the assignment to setup dual web servers behind a ServerIron load balancer in an effort to improve the reliability of my company's website. Unfortunately, I have never done this before where I had to deal with https on redundant servers. My question may be quite simple, but I don't know the answer.
How do I get secure certificates for multiple servers with the same common name? Creating the CSR is the easy part, but last time I tried to get multiple certificates for the same common name, it failed as there was already one certificate created for that name.
Source: http://www.livejournal.com/community/apache/24184.html
-
help please!
Date: 08/20/05
(PHP Community) Keywords: php, web, hosting, apache
This is the first time using actual home made php code. I usually would go and just download a script and use it as is. This time using mostly original components of course all source and reference acquired through php.net. Anyways I am having some trouble though. Let me first give you an idea of my directory setup. I have 'web' as my root directory. And I am working in my 'emu' folder. So it all add's up to 'c:/web/emu'. And I am hosting this using apache, and am using a dns redirect service. My url is http://corpsegristle.dynu.com, and I am working on http://corpsegristle.dynu.com/emulation.php. I cannot just put '/emu' as the directory, I have to include '/web/emu' for it to load up the script and find the roms. But the problem relies in it including the "web" in the url. Notice:
http://corpsegristle.dynu.com/web/emu/a/gen/Aero%20Blasters%20Genesis.rar -bad
http://corpsegristle.dynu.com/emu/a/gen/Aero%20Blasters%20Genesis.rar -good
I need to somehow get this to only include "emu" oppose to including the "web" as well. Or maybe I am missing something all together here. I have tried to include the actual url to my site in the directory but that doesn't work. I appologize if this is a "noob" question. Still new to PHP.
";
//lets split it up for the sake of filetype where $ftype[1] will be the filetype
$ftype=explode(".",$files[$a]);
// WE GOT A RAR FILE
if ($ftype[1]=="rar")
{
//If its a rar file, the text file trails it, so make the link for it first
echo "";
//Increment to the next text file
$a++;
//Read it.
$temp=readfile("$dir\\$files[$a]");
//Dump it. end the link.
echo "
";
//Next please.
$a++;
}
//WE GOT A TXT FILE (then a ZIP)
if ($ftype[1]=="txt")
{
//Well obviously, due to the code before, if it wasnt a rar its a txt file preceeding the zip.
//Increment to link the zip
$a++;
echo "";
//Go back for the text file
$a--;
//Read out the text file now
$temp=readfile("$dir\\$files[$a]");
//format it
echo "
";
//Next please.
$a=$a+2;
}
}
//End meat and potatoes
?>
Source: http://www.livejournal.com/community/php/337883.html
-
Getting Windows user name
Date: 08/31/05
(PHP Community) Keywords: php, apache
I am attempting to create an intranet site at work. We want to be able to authenticate users using active directory, and in such a way that the user doesn't need to put in a password or login name as long as they are logged into active directory(i.e., logged into Windows.) I was wondering if there's anyway I can determine the user's windows login name using either PHP or Apache. The point of this is that the user will simply be able to go to the intranet site from their work PC and use it, without needing to log into the site.
Source: http://www.livejournal.com/community/php/340424.html
-
gmui/php probs
Date: 09/09/05
(Computer Geeks) Keywords: php, mysql, sql, apache
I'm having trouble getting gmui to work properly. I have MySQL and Apache2 running fine behind it, but I just get this:
Warning: displaysite(/var/www/localhost/gmui/./themes/default/template.php): failed to open stream: No such file or directory in /var/www/localhost/htdocs/gmui/class/Core.php on line 369
EDIT:
This is Line 369:
require_once($this->gmui_dir.$this->subDirs['theme_dir'].$_SESSION['user']->theme."/template.php");
* @author Don Seiler
*/
class Core {
/*
* The version of GMUI
*/
var $version;
/*
* Array containing settings for GMUI from conf.php
*/
var $settings = array();
/*
* Array containing all CORE_OP
* where the page refresh should enabled
*/
var $pageRefresh = array("vd", "servers", "upl");
/*
* all available GMUI panels which are optional when mldonkey is running/off
*
*/
var $clientUpPanels = array("vd" => "Downloads", "s" =>"Search", "dllink" => "Links",
"upl" => "Uploads", "upstats" => "Statistics", "servers" => "Servers", "shares" => "Shares",// "vfr" => "Friends",
"cmd" => "Console", "opt" => "Client Options", "uopt" => "User Options",
"umanage" => "Users", "gmanage" => "Groups", "other" => "Other", "inc" => "Incoming", "kill" => "Kill Client", "logout" => "Logout");
var $clientDownPanels = array("umanage" => "Users", "gmanage" => "Groups",
"other" => "Other", "uopt" => "User Options", "inc" => "Incoming",
"start" => "Start Client", "logout" => "Logout");
/*
* GMUIs subdirectories
*/
var $subDirs = array( "conf_dir" => "./conf/",
"lang_dir" => "./lang/",
"theme_dir" => "./themes/",
"client_dir" => "./client/",
"bin_dir" => "./bin/",
"lib_dir" => "./lib/");
/*
* GMUIs priority mapping
*/
var $priorities = array();
/*
* reload id
*/
var $refreshed = FALSE;
/*
* client stat
*/
var $alive;
/*
* settings from conf.php
*
*/
var $gmui_dir;
var $gmui_http;
var $client_basedir;
var $client_startup;
var $client_incoming;
var $min_page_refresh;
var $data_sync_time;
var $use_javascript;
var $allow_http_download;
var $allow_http_upload;
var $max_upload_size;
var $make_commit_script;
var $use_hard_links;
var $include_incoming_size;
var $max_displayed_sources;
var $max_displayed_names;
var $content_src;
var $use_http_auth;
var $use_db;
var $sqlite_db_file;
var $mysql_user;
var $mysql_passwd;
var $mysql_host;
var $mysql_db;
/*
* use php file functions, workaround for file too big errors
*/
var $use_php_ff;
/**
* Constructor for Core class
*
* Loads all settings and initializes what is needed.
*/
function Core()
{
$this->loadSettings();
$this->checkSettings();
}
/*
* hack to use settings during Core Object is created
*/
function postInit()
{
$this->setVersion();
$this->setInterface();
$this->setDataBase();
$this->setPriorities();
}
function setPriorities() {
$this->priorities = array(
"-20" => _("Very Low"),
"-10" => _("Low"),
"0" => _("None (priority)"),
"10" => _("High"),
"20" => _("Very High")
);
}
/**
* Get database wrapper Object
*
* @author Moritz Warning
*/
function setDataBase() {
require($this->subDirs['conf_dir']."config.php");
if($use_db == "sqlite") {
$_SESSION['db'] = new SQLite($sqlite_db_file);
} elseif ($this->use_db == "mysql") {
$_SESSION['db'] = new MySQL($mysql_user, $mysql_passwd, $mysql_host, $mysql_db);
} else exit(''._("No valid database type selected!")."
\n");
}
/**
* Get Interface Objekt to get data from MLDonkey
*
* @author Moritz Warning
*/
function setInterface() {
require($this->subDirs['conf_dir']."config.php");
$_SESSION['interface'] = new MLD_Interface($client_host, $client_port, $client_user, $client_passwd);
$_SESSION['interface']->postInit();
}
/**
* Grabs version from VERSION file
*
* @author Don Seiler
*/
function setVersion() {
if (file_exists("./VERSION")) {
$lines = file("./VERSION");
$this->version = $lines[0];
} else {
exit(''._("Version File not found!")."
\n");
}
}
/**
* Return available languages.
*
* @author Moritz Warning
*/
function getLanguages() {
return getDirs($this->subDirs['lang_dir']);
}
/**
* Return available themes
*
* @author Moritz Warning
*/
function getThemes() {
return getDirs($this->subDirs['theme_dir']);
}
/**
* Loads core settings into $this->settings array
*
* @author Moritz Warning
*/
function loadSettings() {
$conf_file = $this->subDirs['conf_dir']."config.php";
if (!file_exists($conf_file)) {
exit(''."Required file conf/config.php not found!"."
\n");
}
require($conf_file);
//check for optional $gmui_dir in conf.php
if(!isset($gmui_dir)) {
$this->gmui_dir = dirname($_SERVER["DOCUMENT_ROOT"].$_SERVER["PHP_SELF"]).DIRECTORY_SEPARATOR;
} else {
$this->gmui_dir = $gmui_dir;
}
//check for optional $gmui_http in conf.php
if(!isset($gmui_http)) {
$this->gmui_http = dirname("http://".$_SERVER["SERVER_ADDR"].":".$_SERVER["SERVER_PORT"].$_SERVER["PHP_SELF"]).DIRECTORY_SEPARATOR;
} else {
$this->gmui_http = $gmui_http;
}
//needed settings in ./conf/conf.php
$this->client_basedir = $client_basedir;
$this->client_startup = $client_startup;
$this->client_incoming = $client_incoming;
$this->data_sync_time = $data_sync_time;
$this->min_page_refresh = $min_page_refresh;
$this->use_javascript = $use_javascript;
$this->allow_http_download = $allow_http_download;
$this->allow_http_upload = $allow_http_upload;
$this->max_upload_size = $max_upload_size;
$this->make_commit_script = $make_commit_script;
$this->chmod = $chmod;
$this->use_hard_links = $use_hard_links;
$this->include_incoming_size = $include_incoming_size;
$this->max_displayed_sources = $max_displayed_sources;
$this->max_displayed_names = $max_displayed_names;
$this->content_src = $content_src;
$this->use_http_auth = $use_http_auth;
$this->use_db = $use_db;
$this->use_php_ff = $use_php_ff;
//other settings, depend on others
if($use_db == "sqlite") {
$this->sqlite_db_file = $sqlite_db_file;
} elseif($use_db == "mysql") {
$this->mysql_user = $mysql_user;
$this->mysql_passwd = $mysql_passwd;
$this->mysql_host = $mysql_host;
$this->mysql_db = $mysql_db;
}
}
function checkSettings() {
$check_settings = array(
'client_basedir',
'client_startup',
'client_incoming',
'min_page_refresh',
'data_sync_time',
'use_javascript',
'allow_http_download',
'allow_http_upload',
'max_upload_size',
'make_commit_script',
'use_hard_links',
'include_incoming_size',
'max_displayed_sources',
'max_displayed_names',
//'content_src', this may be empty b y purpose
'use_http_auth',
'use_db'
);
foreach ($check_settings as $setting) {
$value = $this->{$setting};
if (is_null($value) or $value === "") {
$missingsettings[] = $setting;
}
}
if(count($missingsettings) > 0) {
$errorstring = "\nConfig file incomplete. The following values are missing:
\n\n";
foreach ($missingsettings as $setting) {
$errorstring .= "- $setting
\n";
}
$errorstring .= "
\n\n";
$errorstring .= "If you have recently upgraded, please check config.php.sample for any new settings.\n";
exit($errorstring);
}
}
/**
* Lets you know if a menu item is currently active
*
* @author CJ Kucera
*/
function isMenuActive($menu)
{
return ($_SESSION["active"] == $menu);
}
/**
* Returns a list of available menu items, for themes
*
* @author Moritz Warning
*/
function getMenu() {
$menu = array();
$panels = array();
if($this->alive) { $panels = $this->clientUpPanels; }
else { $panels = $this->clientDownPanels; }
foreach($_SESSION['user']->titlebar as $id) {
if(isset($panels[$id])) {
$menu[] = new MenuItem($id, _($panels[$id]), $this->isMenuActive($id));
}
}
return $menu;
}
/*
* this function print the entire site using getSite() in themes/template.php
*
* Moritz Warning
*/
function displaySite() {
$this->setConstants();
$this->setAlive();
$this->setLanguage();
$this->setTimeMark();
//update users downloads and settings
if($this->timemark) {
$_SESSION['user']->refill_settings();
$_SESSION['user']->refill_downloads();
}
require_once($this->gmui_dir.$this->subDirs['theme_dir'].$_SESSION['user']->theme."/template.php");
echo getSite(); //getSite is part of the theme
//reset text variables
$_SESSION['title'] = "";
$_SESSION['message'] = "";
$_SESSION['headline'] = "";
exit();
}
//$this->subDirs
/*
* set constants
*
* Moritz Warning
*/
function setConstants() {
define("NL", "\n");
define("BN", "
\n");
define("BBN", "
\n");
}
/*
* set alive status of the client
*
* Moritz Warning
*/
function setAlive() {
$this->alive = $_SESSION['interface']->alive();
}
/*
*
set gettext variables
*
* Moritz Warning
*/
function setLanguage() {
$lang = $_SESSION['user']->lang;
if($lang == "en") {
setlocale(LC_ALL, 'en_US');
} else {
setlocale(LC_ALL, $lang."_".strtoupper($lang));
}
putenv("LANG=".$lang);
bindtextdomain('messages', $this->subDirs['lang_dir']);
textdomain('messages');
}
/*
* set $this->timemark every $data_sync_time seconds (set in config.php)
*
* Moritz Warning
*/
function setTimeMark() {
$this->timemark = FALSE;
if(!isset($_SESSION['last_time_check']) OR (time() - $_SESSION['last_time_check']) > $this->data_sync_time) {
$_SESSION['last_time_check'] = time();
$this->timemark = TRUE;
}
}
/**
* Reads $_REQUEST var and takes appropriate action
*
* @author Don Seiler
* @author Moritz Warning
*/
function getBody() {
$core_op = $_REQUEST["CORE_OP"];
if(!$this->alive) {
$_SESSION['was_dead'] = TRUE;
}
list($prefix,$suffix) = explode("_", $core_op);
//set CORE_OP if it is not valid
if(!$_SESSION['user']->allow_show_Menu($prefix)) {
if(!empty($core_op)) {
$core_op = "";
$prefix = "";
} elseif($this->alive AND $_SESSION['user']->allow_show_Menu("vd")) {
$core_op = "vd"; //default is CORE_OP when not set and "vd" allowed
$prefix = "vd";
}
}
$_REQUEST["CORE_OP"] = $core_op; //reset core_op because other programms use it
$this->dbCare();
//select availabel panels
$panels = array();
if($this->alive) { $panels = $this->clientUpPanels; }
else { $panels = $this->clientDownPanels; }
if(function_exists($core_op)) {
$_SESSION["title"] = "Web-GMUI: ".$panels[$prefix];
$_SESSION["active"] = $prefix;
$content = call_user_func($core_op);
} else {
$_SESSION["title"] = "Web-GMUI: "._("Welcome");
$_SESSION["active"] = "";
$content = "";
}
return $content;
}
/*
* dbCare check if mlnet was restarted and initiate an auto reassignment program (verify_db)
*
* Moritz Warning
*/
function dbCare() {
$restarted = FALSE;
if($this->alive AND $_SESSION['was_dead']) {
$restarted = TRUE;
$_SESSION['was_dead'] = FALSE;
}
if($this->alive AND !$restarted AND ($_REQUEST["CORE_OP"] == "vd")) {
$restarted = $_SESSION['interface']->check_MLDrestart();
}
if($restarted) {
$check_all = FALSE;
if($_SESSION['user']->username == "admin") { $check_all = TRUE; }
$_SESSION['user']->verify_db($check_all);
$_SESSION['user']->refill_downloads();
} elseif($this->alive AND $this->timemark) {
$_SESSION['user']->remove_finished();
}
}
/*
* logout - what should i say any more? ;)
*
* Moritz Warning
*/
function logout() {
//for gettext tool
_("Logout");
$_SESSION['user']->search_delAll();
unset($_SESSION);
session_destroy();
if($this->use_http_auth) { //send a 401 to clear the browser cache
Header('WWW-Authenticate: Basic realm="Logout"');
Header('HTTP/1.0 401 Unauthorized');
}
}
}
?>
x-posted to #linux and #computergeeks
Source: http://www.livejournal.com/community/computergeeks/771090.html
-
mon.
Date: 09/22/05
(IT Professionals) Keywords: virus, spyware, linux, apache
I am looking for a Free or Cost Effective Network Monitoring package. It can run on either Windows 2000 Server or FreeBSD/Linux preferred. Right now I love the fact that if there is a virus outbreak or my firewall is compromised, or we have a “spyware/greyware” problem I get an email stating this right to my Treo. I would love for something to monitor services on various servers or even if the servers are up and running. Internally we have apache, samba and DNS. Externally I need to monitor FTP, Apache, DNS, Sendmail. These neverreally fail but would like to keep an eye on them, and actually if the server itself has a problem and goes down. We also have a 2K server running various applications here my concern is if the server is really up more or less.
Source: http://www.livejournal.com/community/itprofessionals/23728.html
-
recompiling apache and PHP
Date: 09/23/05
(PHP Community) Keywords: php, software, apache
I recompiled apache and PHP months ago to install mcrypt and cURL so billing software would work. I've recently changed billing software, and while troubleshooting the install, found that it wasn't working correctly because mcrypt wasn't installed. So I'm wondering...where'd it go? It *was* installed. Even if apache has upgraded itself recently, it wouldn't make sense that mods would need to be reinstalled each time. I'm just wondering if this has happened to anyone else? I know I'm not providing a lot of details....but I'm not quite sure where to start looking.
X-posted to apache and my own journal.
Source: http://www.livejournal.com/community/php/345986.html
-
Recompiling apache and PHP
Date: 09/23/05
(Apache) Keywords: php, software, apache
I recompiled apache and PHP months ago to install mcrypt and cURL so billing software would work. I've recently changed billing software, and while troubleshooting the install, found that it wasn't working correctly because mcrypt wasn't installed. So I'm wondering...where'd it go? It *was* installed. Even if apache has upgraded itself recently, it wouldn't make sense that mods would need to be reinstalled each time. I'm just wondering if this has happened to anyone else? I know I'm not providing a lot of details....but I'm not quite sure where to start looking.
X-posted to php and my own journal.
Source: http://www.livejournal.com/community/apache/25754.html
-
Host for beta test site.
Date: 09/24/05
(Web Development) Keywords: php, mysql, sql, web, apache
I'm looking for a cheap host which offers the following:
- MySQL 4 with InnoDB support
- PHP 4 with GD/Image manipulation module
- Apache mod_rewrite support
I'm looking to set up a beta test website for an open source myspace/friendster clone that I'm working on called Appleseed (http://appleseed.sourceforge.net).
Let me know if you have any suggestions.
Update: I need SSH access, too.
Source: http://www.livejournal.com/community/webdev/246550.html
-
sendfile in PHP
Date: 09/26/05
(PHP Community) Keywords: php, web, apache
Howdy folks.
The Apache webserver has the ability to use the sendfile()
syscall to efficiently send static files. This feature copies from the file to the socket at the kernel level and is thus very efficient. I'm currently writing an app in PHP which will need to efficiently send a large file to the user without clients being able to request the file directly.
My question is whether there's any way to get at this from PHP land. I see the virtual()
function which causes Apache to perform a subrequest, but I'm hoping there's a way to do it without incurring the subrequest overhead. I've also seen PHP's readfile()
function and its friends, but I suspect (please correct me if I'm wrong) that the copying between file and socket will then happen in PHP land.
Alternative approaches are welcome too. :)
Source: http://www.livejournal.com/community/php/347342.html
-
I'm dazzled.
Date: 10/04/05
(PHP Community) Keywords: php, html, apache
form.html:
< form action="script.php" method="post">
< input type="text" name="user">
< input type="submit" name="submit" >
< /form>
script.php:
The script shows nothing no matter whether I use GET or POST.
Maybe the problem is somewhere in PHP settings?
I use Apache 2/PHP 4.3.9 on Darwin (Mac OS X 10.3).
Could you please help me?
Source: http://www.livejournal.com/community/php/349832.html
-
fake 404 error redirection.
Date: 10/04/05
(PHP Development) Keywords: php, apache
ok, so maybe I have this thought out incorrectly, so I am looking for some advice.
In my apache config we have
ErrorDocument 404 /path/to/file.php
so that anything that receives a 404 response should get redirected...
I have a script..
header("HTTP/1.1 404 Not Found");
?>
This sends a 404 message. I would expect it to redirect to the ErrorDocument, but it doesn't Is this what is suppose to happen? or am I missing a piece to the puzzle?
Source: http://www.livejournal.com/community/php_dev/60484.html
-
Java Annotation based Frameworks
Date: 10/07/05
(Java Web) Keywords: apache
Now everyone and their Mother-in-law is jumping in the Annotation bandwagon. I believe Cedric was the first developer to come up with an annotation based framework - TestNG.
Now we have Stripes which I think is pretty decent. Then came JBoss Seam and now Apache's Beehive. They are all annotations based framework or components designed to [...]
Source: http://blog.taragana.com/index.php/archive/java-annotation-based-frameworks/
-
favorite benchmark utility?
Date: 10/12/05
(MySQL Communtiy) Keywords: php, mysql, sql, apache
I'd like to hear what (if any) you all use for benchmarking.
I'm currently doing some benchmarks for dynamic content on a php/mysql setup between Apache and LightTPD. I'm currently using "siege" but it's not working out as well as I hoped. Any application suggestions are welcome. :D
thanks!
Source: http://www.livejournal.com/community/mysql/70392.html
-
GD Library
Date: 10/13/05
(PHP Community) Keywords: php, browser, apache
I'm on WinXP and am trying to get the GD library to work. I got the "Fatal error: Call to undefined function: imagecreate()" message.
From the php manual:
On windows.
When you get undefined function image* it means the gd library isnt being used. Check the php.ini file. Make sure the php_gd.dll isnt commented out. Restarting apache should result in the image functions working.
The GD Library FAQ says the same thing. My extension dir is correct, and I uncomment out the required line. When I load the page in my browser I get:
Warning
Unknown(): (null): Unable to initialize module
Module compiled with module API=20040412, debug=0, thread-safety=1
PHP compiled with module API=20020419, debug=0, thread-safety=1
These options need to match
I can't really make sense of this, and was wondering if you guys could help.
Source: http://www.livejournal.com/community/php/354706.html
-
Open Source Java Application Server Geronimo Passes Java 2 Enterprise Edition 1.4 Certification
Date: 10/19/05
(Java Web) Keywords: software, java, web, apache
With its latest release of the software, Apache announced that Geronimo 1.0-M5 Java application server has passed all the compatibility tests and has gained official J2EE1.4 certification of the Java server software standard.
Apache Geronimo 1.0-M5 is completely integrated with the Tomcat Web server and includes a developer preview of web management console submitted to [...]
Source: http://blog.taragana.com/index.php/archive/open-source-java-application-server-geronimo-passes-java-2-enterprise-edition-14-certification/
-
mod_rewrite
Date: 10/19/05
(Apache) Keywords: php, database, web, google, apache
Ok, i am a little new to apache, so go easy on me.
I have an database based website that uses id's to call each page e.g http://www.somesite.co.uk/index.php?id=1
now this i all very nice, but i find that url a little long for me, so i would like to be able to make it into something like http://www.somesite.co.uk/1
now i know this would have implications like if i wanted to sent to a folder past the root, like http://www.somesite.co.uk/images/1.jpg so it would have to have exceptions setup to.
now i have been told that this can be done with a mod_rewrite, but i have spend days pouring over documentation, google hits etc and i have yet to manage to do this. is there anyone out there who has a any clue's?
Thanks for any help
Source: http://www.livejournal.com/community/apache/26263.html
-
New to PHP's file functions
Date: 10/25/05
(PHP Community) Keywords: php, html, web, apache
Hi all,
I'm trying to muddle through a site redesign of my website, and I've hit a stumbling block when it comes to the php file functions.
When I try to run the following script:
$string = '';
$filename = 'test2.php';
// file_put_contents ($filename, $string); --- Doesn't work on my version of php.
fopen ($filename, 'w');
fwrite ($filename, $string);
fclose ($filename);
The following happens: the file test.php is created with no data and permissions set at 644. The directory has permissions of 777 for testing purposes. I also get the following errors displayed onscreen:
Warning: fwrite(): supplied argument is not a valid stream resource in /home/name/public_html/dev/test.php on line 21
Warning: fclose(): supplied argument is not a valid stream resource in /home/name/public_html/dev/test.php on line 22
What I want to happen is this: test2.php is created, with the string as the contents.
I'll build in some validators after I get this part working.
I'm using PHP Version 4.3.9, on Apache. It's a remote site, so I'm not sure that upgrading my version of php is a viable option.
Any ideas? Is there something I'm missing?
Source: http://www.livejournal.com/community/php/357455.html