Comments (25)
This is a problem in PHP itself, it seems that the temp directory is
detected incorrectly. See Issue 23 for a similar problem, the solution
for session files temp dir or upload temp dir is to set the
"session.save_path" or "upload_tmp_dir" php.ini options by using
ini_set() or by editing php.ini in the php/ folder.
But this will probably won't work in other cases that need a general
temp directory. There is an another php option "sys_temp_dir" that
you can try set, the php documentation says that it is available only
since php 5.5.0, I've found the php bug 60524 that solves this issue
and provides patches for other php versions:
https://bugs.php.net/bug.php?id=60524
Try one of these, it probably won't work in php 5.4, but it won't hurt
to test it:
1. ini_set("sys_temp_dir", "C:/Windows/Temp");
2. Edit php.ini and add: sys_temp_dir=C:/Windows/Temp
The php documentation says that the "sys_temp_dir" option is PHP_INI_SYSTEM,
meaning it can be set only through php.ini,
Let me know if setting "sys_temp_dir" works in php 5.4, if not then we will
have to provide our own custom build of PHP 5.4 to solve this issue.
If you are fine using php 5.5 then you can fix it yourself by updating the
binaries, the downside of using php 5.5 is that it doesn't support Windows XP
anymore.
Original comment by [email protected]
on 4 Jul 2013 at 6:27
- Changed state: Accepted
from phpdesktop.
Thanks for responding so quickly. I had the session and file upload problem
myself and put the "session.save_path" and "upload_tmp_dir," directives in
php.ini already. I found that thread on php.net too, so I had the
"sys_temp_dir," directive as well. It doesn't seem to do anything. I tried
putenv too.
At any rate, I went to window.php.net and got the VC11 x86 Non Thread Safe
release of php 5.5. I installed this in the program folder for PHP Desktop. The
way I did this was I just copied the files from the php folder in my downloads
to the php folder of PHP Desktop. I also copied the ext files (the same files
that were with PHP Desktop).
Now, when I launch PHP Desktop, I get an error "MSVCR110.dll is missing from
your computer." I Googled this and found that it meant I didn't have the right
VC++ Redistributable. I got the right one from Microsoft:
http://www.microsoft.com/en-us/download/details.aspx?id=30679
I got this installed; but the error is still there, so I'm not able to test
whether php 5.5 will solve the problem.
Original comment by [email protected]
on 5 Jul 2013 at 2:02
from phpdesktop.
On the Visual C++ Redistributable page you pasted link to I see a few files:
VSU3\vcredist_arm.exe 1.4 MB
VSU3\vcredist_x64.exe 6.9 MB
VSU3\vcredist_x86.exe 6.2 MB
Which one did you install? You are supposed to install vcredist_x86.exe,
as you have downloaded php 5.5 x86.
Original comment by [email protected]
on 5 Jul 2013 at 2:35
from phpdesktop.
Ok, thanks for your help. I had the x64 version installed. I got PHP 5.5 to
work and it changed the temp folder just fine with that php.ini directive!
Unfortunately, the extension that I'm trying to use (imagick) doesn't work with
php 5.5 yet.
So, to get this to work, do I just need to apply that php patch and then build
5.4 from source?
Original comment by [email protected]
on 5 Jul 2013 at 6:37
from phpdesktop.
> So, to get this to work, do I just need to apply that php patch and
> then build 5.4 from source?
Yes, that patch adds support for setting temporary directory, if setting
sys_temp_dir works for you in php 5.5 then this patch will make it work
the same in php 5.4.
Notice that the patch for php 5.4 has the option named "system_temp_dir",
in php 5.5 it is "sys_temp_dir", you can see the commit to php 5.5 here:
https://github.com/php/php-src/commit/475a644bd84c071da04b4272b829a187a2c6d282
Original comment by [email protected]
on 5 Jul 2013 at 6:59
from phpdesktop.
There might be a simpler solution for php 5.4, try this:
<?php
putenv("TMP=C:/Windows/Temp");
putenv("TEMP=C:/Windows/Temp");
putenv("TMPDIR=C:/Windows/Temp");
?>
It seems that on Windows the TMP and TEMP environment variables are checked,
the TMPDIR is probably only for Linux/Mac.
You could use the auto_prepend_file directive to set it up for all scripts.
For reference: http://stackoverflow.com/a/13254317/623622
Original comment by [email protected]
on 6 Jul 2013 at 5:52
from phpdesktop.
John, can you confirm that in php 5.5 the temp directory is also "C:\Windows"?
I've found the php bug #64410 that is about the issue we're having:
https://bugs.php.net/bug.php?id=64410
Original comment by [email protected]
on 6 Jul 2013 at 2:08
from phpdesktop.
All those putenvs work in 5.4 and 5.5. They change the temp directory. In 5.5,
before putting those in, the temp dir was c:\windows.
I actually found that this didn't solve my problem with ImageMagick. IM is
trying to use some other temp dir. I gave up on it for now, but the
c:\windows\temp should be fixed with the solution you gave above.
Original comment by [email protected]
on 8 Jul 2013 at 6:32
from phpdesktop.
What directory is IM trying to use even after using putenv() fix? This
would mean that IM is trying to detect the temporary directory on its own,
but this is very unlikely IMO. Or it is being detected and kept when the
extension is being imported, this seems odd, but in this case the php.ini
"sys_temp_dir" should fix this.
Try this for the magick problem:
<?php
putenv("MAGICK_TEMPORARY_PATH=C:/Windows/Temp");
putenv("MAGICK_TMPDIR=C:/Windows/Temp");
putenv("MAGICK_TMP=C:/Windows/Temp");
putenv("MAGICK_TEMP=C:/Windows/Temp");
putenv("IMAGICK_TEMPORARY_PATH=C:/Windows/Temp");
putenv("IMAGICK_TMPDIR=C:/Windows/Temp");
putenv("IMAGICK_TMP=C:/Windows/Temp");
putenv("IMAGICK_TEMP=C:/Windows/Temp");
?>
Original comment by [email protected]
on 8 Jul 2013 at 7:04
from phpdesktop.
I've checked sources of the imagick extension:
http://pecl.php.net/package/imagick
I haven't found anywhere in the sources anything related to the temp directory,
it seems that they are not using any temp directory, so I'm confused right now.
Original comment by [email protected]
on 8 Jul 2013 at 7:25
from phpdesktop.
There was a response in bug 64410 that states this is an environment issue
in Windows 8, probably a TMP/TEMP environmental variable is missing, it
probably affects other applications as well. The fix for php 5.4 is to use
putenv(), for php 5.5+ additionally sys_temp_dir is usable.
Original comment by [email protected]
on 9 Jul 2013 at 6:19
from phpdesktop.
Thanks for your help. ImageMagick does use a different temp dir from what I've
read in the documentation. I think it uses the appdata temp folder. I tried the
MAGICK_TEMPORARY_PATH variable, but not the others. After working with this
issue for a while, I don't think it's a problem with PHP Desktop, although I
think it's important to set the temp dir at any rate. I'm running the
ImageMagick processes on my server for now.
Original comment by [email protected]
on 9 Jul 2013 at 6:41
from phpdesktop.
A php example script will be added to the php desktop binaries with an
exaplanation that PHP temp environment variables should be set on this OS.
Original comment by [email protected]
on 21 Jul 2013 at 6:38
- Added labels: NextRelease
from phpdesktop.
Original comment by [email protected]
on 19 Jan 2014 at 7:39
- Changed title: Add an example of setting temp dir on Win8 to solve tmp dir problems on this OS.
from phpdesktop.
Issue 41 has been merged into this issue.
Original comment by [email protected]
on 19 Jan 2014 at 7:39
from phpdesktop.
Issue 23 has been merged into this issue.
Original comment by [email protected]
on 19 Jan 2014 at 11:40
from phpdesktop.
Original comment by [email protected]
on 21 Jan 2014 at 12:32
- Added labels: Priority-High
- Removed labels: NextRelease, Priority-Medium
from phpdesktop.
Issue 23 has been merged into this issue.
Original comment by [email protected]
on 22 Jan 2014 at 4:07
from phpdesktop.
I have investigated the issue again and the problem was that the TMP
environment variable was not set by the Mongoose webserver. Fixed in revision
89f4820f0bf1. Added the upload and session examples.
Original comment by [email protected]
on 22 Jan 2014 at 4:07
from phpdesktop.
Original comment by [email protected]
on 22 Jan 2014 at 4:07
- Changed state: Fixed
from phpdesktop.
Issue 41 has been merged into this issue.
Original comment by [email protected]
on 22 Jan 2014 at 4:08
from phpdesktop.
Fix for the Chrome branch in revision 667c09e8668d.
Original comment by [email protected]
on 22 Jan 2014 at 5:38
from phpdesktop.
Version 31.3 of PHP Desktop Chrome released.
Version 1.11 of PHP Desktop MSIE released.
Original comment by [email protected]
on 22 Jan 2014 at 9:13
from phpdesktop.
Project will move to Github. Find this issue at the new address (soon):
https://github.com/cztomczak/phpdesktop/issues/39
Original comment by [email protected]
on 24 Aug 2015 at 3:20
from phpdesktop.
On W10, the C:\windows\temp is not writeable either for a non-admin user... So ps-files-cleanup-dir error comes out often... No php putenv or htaccess SetEnv works.
from phpdesktop.
Related Issues (20)
- Update HOT 4
- Bootstrap 5 off canvas, modals, burgur menu dropdowns is not working in php-desktop for windows. HOT 5
- Any version without chrome HOT 5
- Algum procedimento recomendado para a lib funcionar na versão 7.4 do php?
- Most links on Build/Windows are dead? HOT 2
- slowness HOT 1
- How to upgrade the CEF version? HOT 2
- Unable to play local video HOT 3
- Bootstrap js and Nav Js not work HOT 2
- Compilation : 'OVERRIDE' : unknown substitution specifier HOT 1
- Uncaught (in promise) ReferenceError: AbortController is not defined
- Codeigniter 4 sqlite3 connection problem HOT 3
- Code protection suggestion HOT 7
- Is PHP Desktop compatible with Laravel latest ( versrion 10.x now )?
- Default Window Size But
- how to update the chromium version HOT 6
- how to build this project HOT 3
- Why does php desktop run slow when the machine is connected to internet???
- mp4 format video not working in php desktop HOT 2
- Browser Not Supported HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpdesktop.