Hi Dan
Thanks for the reply. I've been away for a while.
My guess is that when the file is uploaded it goes into the temp folder and is owned by '48' - the httpd user. When the PHP script then transfers it to the relevant folder in the web-root, it the owner is not changed.
I have attempted to 'chown' using a PHP script but that doesn't work - this is why I want to determine the current user/group of the running...
User Profile
Collapse
-
How to Find out the current USER/GROUP of the php script
Hi
I am trying to debug an upload script and I need to know what the user/group is of the php-script that's running.
My problem is that the webserver settings have '48' as the user/group - presumably 48 means httpd. But when I upload files through PHP, they are moved from the temp folder and the permissions are 744 with the owner as '48'. This means I can't change the file in FTP/SSH.
I am trying to... -
Well it turns out it was permissions. I had uploaded a whole folder and this was causing problems. Making a new folder and copying the contents across solved the problem.Leave a comment:
-
403 on CSS via Sym Link
Hi
I have a css file stored outside the server root and a symbolic link to it in the server root. The result is a 403 (Forbidden) error from the server.
EG:
/var/www/html = where my site is
/var/www/css = where my css is
/var/www/css/test.css = my css file
/var/www/html/css = symbolic link to /var/www/css
I have included...Code:www.domain.com/css/test.css --> error 403
-
This is a bit blunt and will fail on words like 'ate' which will match 'gate' but it's quicker than strstr(). You can use preg_match:Code:$str='tree:sweet:house:gate:tent' if (strpos($str,'sweet')>=0) { //is there }
ps. you need the right...Code:$str='tree:sweet:house:gate:tent' if (preg_match($regex,$str)>0) { //at least one match }Leave a comment:
-
This isn't php...
but according to help:
for windows (ps you can see this help message by typing "shutdown -?" in command prompt).Code:shutdown -m //computername
You could run this from PHP using exec.
You can try PsExec to run commands on remote machines. Again you would need to work out the correct command and then insert it into the exec() function...Leave a comment:
-
If the PC is connected to your PHP application (ie website) then you can get the IP address from $_SERVER['REMOTE_ADDR']
So you just need to collect this value in a database or other storage medium. If you log the time against the IP then you can say at one point in time, which computers were connected.
You could alternatively run ping with php exec() function and record the output:
eg
...Leave a comment:
-
Do you want the toolbar permanently in the users' browsers? You would need to write your own add-on. The firefox setup isn't too hard - at least for simple requirements...
http://www.rietta.com/firefox/Tutorial/conf.html
is a tutorial, many available
Of course the toolbar will be browser specific so you'll need to program one for each browser. I bet you could hack up the yahoo-firefox toolbar as a starting...Leave a comment:
-
I don't believe it - are you saying absolutely no way possible? Couldn't he write javascript which generates its own scroll bar and controls it according to exactly his parameters?
Nothing is impossible - I'm not saying I know how though!Leave a comment:
-
Are the divs getting smaller as the window gets smaller?
Try adding the following. You see the horizantal scroll when the window is smaller than 700px wide. If you don't apply width to the div then they will automatically try to fit inside the window.
You can also use "min-width" which lets the divs "flow" to the edges for large...Code:body { width: 700px }Leave a comment:
-
Here is something you could use for the .bat script:
http://www.robvanderwoude.com/files/battrun_xp.txt...Leave a comment:
-
Hi Roshin
Sorry it wasn't as easy as I suggested! You can fix it, as the error says, by enabling ssl. I didn't realise WAMP doesn't enable by default...
Quick Instructions:
open php.ini
uncomment line ";extension=php _openssl.dll"
restart WAMP
Verbose...
- you should find a link to php.ini if you left click on the WAMP icon in the taskbar
- look for "config...Leave a comment:
-
Leave a comment:
-
You would probably need to install a script on the target PC which sends the values to your server - eg, inserts into a database.
ie...
1. Shell Script:
Collects the information.
Goes to a URL (eg script.php?ip=1 92.168.2.2&powe r=240W) (you could have it launch this URL in a browser window or there is probably a command line way to do this too).
(You could do this with PHP but you would need...Leave a comment:
-
That's fine! I'd seen this one but it seems like it was one of those occasions where I just didn't type the right thing into google yesterday!
I just found this:
http://php.dtbaker.com.au/post/cachi..._php_imagejpeg
The solution is to use the last-modified header based on the filemtime() for the input file. The article has a solution if you have no input file too. The browser now caches the images....Leave a comment:
-
I found that phpmailer was the easiest solution. I attempted to setup the SMTP in php and found it wouldn't quite work but I got phpmailer working in about 5 minutes.
Another method I did try in Windows was to use blat with stunnel and then use exec() to send the blat command to your computer. You can google blat and stunnel - both free software.
Unless you have a specific reason not to try phpmailer, I really would...Leave a comment:
-
try phpmailer:
http://sourceforge.net/projects/phpmailer
When you download it, look in the examples and there is one for gmail. It doesn't require any changes to your php setup, just setup the script correctly as in the example...Leave a comment:
-
I changed the default user and group in the apache configuration file - the server is just for testing so it doesn't matter (I hope!) - I got fed up of my scripts breaking because they weren't allowed.
There is a line in the apache2.conf
User ...
Group ...
I used my user and group.Leave a comment:
-
expires header on php generated image
I am trying to make my php-generated images cache. Here is a summary of the script with the headers. It doesn't seem to cache though. Do I need to do something special to make sure it caches?
[code=php]
//summarised
//resize...
$file= $_GET['file'];
$o= imagecreatefrom gif($file);
$i= imagecreatetrue color($w,$h);
imagecopyresamp led($i,$o,0,0,0 ,0,$w,$h,$wo,$h o);
//output... -
Yes, it was being blocked by the web-host's firewall.
Thanks for tips!
HenryLeave a comment:
No activity results to display
Show More
Leave a comment: