473,465 Members | 1,903 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Run PHP scripts outside of the web directory

Hello,
Is it possible to run a script that will be used from all the websites
on the server outside of the web dir ?
At the moment for every site I have I upload the script in the web dir
of the specific site...

Specifically it is a RichEditor so it has javascripts as well ...
But it is difficult to maintain updates of the script to all websites
so I would prefer if I had only one place to update it...

Any ideas will be appreciated.

Angelos.

Feb 13 '07 #1
6 2388
"Aggelos" asked...
: Is it possible to run a script that will be used from all the
: websites on the server outside of the web dir ?

If the server is a Windows server, take a look at these
two commands inside a cmd.exe prompt...

help ftype
help assoc

The goal involves placing php.exe into the path and then
associating the required php extensions to a common file
type.

If PHP is installed upon a Unix/Linux server, someone else
might be able help there.

--
Jim Carlock
Post replies to the group.
Feb 13 '07 #2
If the server is a Windows server, take a look at these
two commands inside a cmd.exe prompt...
Nope it is Unix. :(

Thanks

Feb 13 '07 #3


Aggelos wrote:
Hello,
Is it possible to run a script that will be used from all the websites
on the server outside of the web dir ?
At the moment for every site I have I upload the script in the web dir
of the specific site...

Specifically it is a RichEditor so it has javascripts as well ...
But it is difficult to maintain updates of the script to all websites
so I would prefer if I had only one place to update it...

Any ideas will be appreciated.
As it contains javascript, I understand that it has to be
browser-accessible. In that case, and since you are running unix, I
think a symbolic link is the easiest way.

Another approach is to share the directory in a source code control
system (subversion, for instance), but this will result in physical
multiple copies.

Best regards
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Feb 13 '07 #4
Aggelos wrote:
Is it possible to run a script that will be used from all the websites
on the server outside of the web dir ?
I'm not 100% sure what you're asking for, but it sounds to me like
symbolic links might be the answer.

Say you have three sites hosted on a server, example.com, example.org
and... you guessed it... example.net. These are hosted in the following
directories on the server:

/var/www/vhosts/example.com/
/var/www/vhosts/example.org/
/var/www/vhosts/example.net/

Now, you install some flashy-super-web-based-app into, say:

/var/www/apps/FSWBA/

and you want to make this available as:

http://example.com/FSWBA/
http://example.org/flashy/
http://example.net/flashy-app/

Then all you need to do is create three symbolic links, using the
following commands at the command line:

ln -s /var/www/apps/FSWBA/ /var/www/vhosts/example.com/FSWBA/
ln -s /var/www/apps/FSWBA/ /var/www/vhosts/example.org/flashy/
ln -s /var/www/apps/FSWBA/ /var/www/vhosts/example.net/flashy-app/

And you're done. (Note: you may need to configure Apache to be able to
follow symbolic links, as this ability is often disabled for security
reasons.)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Feb 13 '07 #5
On Feb 13, 3:58 pm, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote:
Aggelos wrote:
Is it possible to run a script that will be used from all the websites
on the server outside of the web dir ?

I'm not 100% sure what you're asking for, but it sounds to me like
symbolic links might be the answer.
I'll try symbolic links then.
I haven't thought that and I believe is the best sollution.

Feb 13 '07 #6

"Aggelos" <dj*****@gmail.comwrote in message
news:11*********************@a34g2000cwb.googlegro ups.com...
Hello,
Is it possible to run a script that will be used from all the websites
on the server outside of the web dir ?
At the moment for every site I have I upload the script in the web dir
of the specific site...

Specifically it is a RichEditor so it has javascripts as well ...
But it is difficult to maintain updates of the script to all websites
so I would prefer if I had only one place to update it...

Any ideas will be appreciated.

Angelos.

I'm sure the other idea about symbolic links is fine, but couldn't you just
put a small "shell" php file with something like

<?php

include ("/path/to/the/real/script");

?>

anywhere you'd like to use the script? This way you change the script in one
place and the includes in the shell file will reflect that in any
application which uses it.

I'm just saying that as you'd be able to avoid having to make symbolic links
for every new app that uses your script.

Denis Gerina
Feb 13 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Dave Smithz | last post by:
Hi There, I have taken over someone else's PHP code and am quite new to PHP. I made some changes and have implemented them to a live environment fine so far. However, I now want to setup a...
3
by: Michele Simionato | last post by:
Is there a simple way to get the path to the Python Tools/scripts directory? Currently I have defined by hand an environment variable such as ...
9
by: Jeff Wagner | last post by:
I have a project of converting numerous DOS cmd shell scripts to Python. Is there a tutorial to getting started? Thanks, Jeff
3
by: sinister | last post by:
I have a site hosted by a commercial webhosting service. As such, I don't have any real control over the webserver (in this case, Apache). What are the most basic, essential elements of security...
3
by: P Wolpert | last post by:
This is my first post. I hope I don't sound stupid. I have a script conflict when I put two scripts on one page. Both scripts will work if I use one at a time but the menu button script will not...
2
by: Jeffry van de Vuurst | last post by:
Hi, (sorry for the crosspost, I wasn't sure which was the best place to put this). I was just thinking about something and wondered if any of you has some ideas about this. I'm using the...
8
by: Alan Isaac | last post by:
Suppose I have a directory `scripts`. I'd like the scripts to have access to a package that is not "installed", i.e., it is not on sys.path. On this list, various people have described a variety...
3
by: joe jacob | last post by:
I configured apache to execute python scripts using mod_python handler. I followed below mentioned steps to configure apache. 1. In http.conf I added <Directory...
0
by: Yansky | last post by:
Hi, I'm having a lot of problems getting any Python scripts to run on my website. I have put them in the cgi-bin directory and chmodded both the directory and files to 755. But when I try to access...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.