Quantcast
Channel: PHP Community
Viewing all 260 articles
Browse latest View live

Permission problems on Wordpress Uploads on IIS 7

$
0
0

I'm a noob on IIS. But I've been looking everywhere for a solution but nothing works. The following mentions 2 problems. I think I've already fixed the first one but the second one is the key issue.

I have Server 2008 x64 Virtual Machine / IIS 7 / Wordpress 2.8 / MySQL NTS / PHP

Everything works fine except media uploads. When I click upload using internet explorer, the blogging platform alerts me that I have a problem:

<div id=media-upload-error>Unable to create directory C:\inetpub\wwwroot\blog/wp-content/uploads/2009/06. Is its parent directory writable by the server?</div> <div> </div> <div>To fix this problem, I allowed NETWORK SERVICE to have access to the uploads folder and I'm able to get as far as writing the folders and the file (*upload path*/2009/06/test.jpg)</div> <div> </div> <div>When I look at the permissions on test.jpg, IIS_IUSRS does not have read access. I can simply change that manually and see the picture on the site.</div> <div> </div> <div>But how can I get NETWORK SERVICE to write test.jpg with IIS_IUSRS permissions set automatically to read? I thought if my uploads folder had IIS_IUSRS permissions set, it would propagate the necessary credentials to the nested folders.</div> <div> </div> <div>Thanks in advance.</div>

Why I can't exec batch file? ???

$
0
0

Hi,
I've tried to use PHP exec() to execute DOS command.
It works with command exec("md example_dir") .
But when I put test.bat in same directory and run PHP with exec("test.bat") , it doesn't work. No error showed but not work.

Anyone can help me?

Thanks.

PHP 5.3.3 on IIS 6.0 help

$
0
0

Hi,

I had installed PHP 5.2.5 earlier on my system and phpinfo() was displaying correctly. But mysql module was missing and hence I decided to upgrade to php 5.3.3. But after the upgrade the browser while executing phpinfo() still displays the details of the older version. When I ask for php version via command prompt it shows me 5.3.3. I have searched and searched but couldn't find anything. I am using pear DB module to connect to the database and it works fine locally but when accessed via browser doesn't work and gives DB Error: Extension not found. But i have php_mysql.dll file in my php\ext folder and I have mentioned the correct path in the php.ini file.

Also, while installing php 5.3.3 using windows installer I used "Do not setup a web sever option" in the "setup a web server wizard'. Is that alright? I have configured IIS to use phpisapi.dll to execute php extension. Would this work with IIS 6.0? I am not uding CGI or FastGCI.
Any help would be appreciated.

Thanks,
Charmie

FastCGI, PHP & APC

$
0
0

Hello,

Has anyone had success getting APC to run under fastcgi? 

 

Any approach to determine the filename on server side?

$
0
0

Referring to following PHP script, the previous one is probably no longer work after the change at the start of last year from bin to bi5.

I would like to sort it out, but it seems impossible to access the data without knowing the correct bi5 filename format.  Is anyone able to sort out what filename format they use? I have tried following code without luck.
Does anyone have any suggestions?

Thanks you very much for any suggestions

Previous version worked before changed, once it changes from bin to bi5, they are no longer working

File to download : http://sdrv.ms/17FwXEF

        $askurl = "http://www.dukascopy.com/datafeed/$pair/$year/$month/$day/ASK_candles_$candletype.bin";
        $bidurl = "http://www.dukascopy.com/datafeed/$pair/$year/$month/$day/BID_candles_$candletype.bin";
        //error("Info: Processing $pair $i - ".gmstrftime("%D %T",$i)." --- $url\n");
        $localpath = "$pair/$year/$month/$day/";
        $asklocalfile = $localpath . "ASK_candles_$candletype.bin";
        $bidlocalfile = $localpath . "BID_candles_$candletype.bin";


Current version is working

File to download : http://sdrv.ms/13UdlKZ

        $url = "http://www.dukascopy.com/datafeed/$pair/$year/$month/$day/{$hour}h_ticks.bi5";
        //error("Info: Processing $pair $i - ".gmstrftime("%m/%d/%y %H:%M:%S",$i)." --- $url\n");
        $localpath = "$pair/$year/$month/$day/";
        $binlocalfile = $localpath . $hour . "h_ticks.bin";
        $localfile = $localpath . $hour . "h_ticks.bi5";


Thanks in advance for any suggestions

Faulting application php-cgi.exe, version 5.3.19.0, faulting module kernel

$
0
0

Hi,

I have a windows 2003 server with iis6 production server, which runs mu companies website (wordpress), and I have a issue with that fast-cgi hangs a lot and connections to the server times out. The server perfomrce very slowly also. I check the server's eventview today and there is a lot of error reports on:

Faulting application php-cgi.exe, version 5.3.19.0, faulting module kernel32.dll, version 5.2.3790.5069, fault address 0x00021671.

EventID 1001 appliction error: Fault bucket -772687241.

I have a ton of these in the log..

Any ide helping me in the right direction to solve this issue is very appreciated!

Thanks! Laughing

PHP browscap on IIS7 works on a Windows 7 Enterprise OS but not on Windows Server 2008 R2 OS

$
0
0

This problem has got me perplexed. Any help greatly appreciated!


The problem: running the following code (simple enough)

<?php
	header('Content-type: text/plain');
	echo 'Browser Info: '.$_SERVER['HTTP_USER_AGENT'].PHP_EOL.
		var_export(get_browser(null, true), true);
?>

get the following error:

PHP Warning:  get_browser(): browscap ini directive not set in C:\inetpub\wwwroot\dotTest\test.php on line 4

Here's what I've done

I'm using the full_php_browscap.ini downloaded from the official site: http://tempdownloads.browserscap.com/

Here's the snippet from my php.ini file

[browscap]
; http://php.net/browscap
browscap = "C:\inetpub\wwwroot\full_php_browscap.ini"

And I learned I had to use the phpmanager tool to change the setting in IIS to pay attention to changes in php.ini. I had to install it from http://phpmanager.codeplex.com/releases/view/69115 on the windows server but not the windows 7 machine interestingly enough.

and from phpinfo() Core section (can't copy the tabular format but here's the info):

Directive: browscap
Local Value: C:\inetpub\wwwroot\full_php_browscap.ini
Master Value: C:\inetpub\wwwroot\full_php_browscap.ini

so we can see it's loading the correct ini file (same file for both machines, one works one doesn't)

I tried checking with procmon: http://technet.microsoft.com/en-us/sysinternals/bb896645 and sure enough the browscap file has read process logs when the server is restarted.

I use the following batch script run as an administrator to make sure that permissions are in order on the server

ICACLS C:\inetpub /grant "IIS AppPool\DefaultAppPool":(OI)(CI)F
ICACLS C:\inetpub /grant "IUSR":(OI)(CI)F
ICACLS C:\Windows\Temp /grant "IIS AppPool\DefaultAppPool":(OI)(CI)F
ICACLS C:\Windows\Temp /grant "IUSR":(OI)(CI)F

(why the temp folder? that's where files get uploaded to from a web upload and for the php_move_uploaded_file method to work permissions need to exist there)

As a sanity check I copy pasted the path C:\inetpub\wwwroot\full_php_browscap.ini from the ini file, and from phpinfo() [they are indeed, in fact, the same path, caps and all not that that caps matter on a whindows machine] into notepad's open file dialog. The file does indeed, in fact open.

I should also mention on the windows server machine this error was constant whether or not browscap was set properly and "(none)" was shown on php.ini while on the windows 7 machine the var_dump simply showed the text 'false'. Now the windows 7 machine shows

Browser Info: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
array (
  'browser_name_regex' => '§^mozilla/5\\.0 \\(.*windows nt 6\\.1.*wow64.*\\).*gecko/.*firefox/20\\..*$§',
  'browser_name_pattern' => 'Mozilla/5.0 (*Windows NT 6.1*WOW64*)*Gecko/*Firefox/20.*',
  'parent' => 'Firefox 20.0',
  'platform' => 'Win7',
  'platform_version' => '6.1',
  'platform_description' => 'Windows 7',
  'win32' => '',
  'win64' => '1',
  'comment' => 'Firefox 20.0',
  'browser' => 'Firefox',
  'version' => '20.0',
  'majorver' => '20',
  'minorver' => '0',
  'beta' => '1',
  'frames' => '1',
  'iframes' => '1',
  'tables' => '1',
  'cookies' => '1',
  'javascript' => '1',
  'javaapplets' => '1',
  'cssversion' => '3',
  'device_name' => 'PC',
  'device_maker' => 'Various',
  'renderingengine_name' => 'Gecko',
  'renderingengine_version' => '20.0',
  'renderingengine_description' => 'For Firefox, Camino, K-Meleon, SeaMonkey, Netscape, and other Gecko-based browsers.',
  'alpha' => '',
  'win16' => '',
  'backgroundsounds' => '',
  'vbscript' => '',
  'activexcontrols' => '',
  'ismobiledevice' => '',
  'issyndicationreader' => '',
  'crawler' => '',
  'aolversion' => '0',
)

while the windows server machine still shows the error. Any ideas why it wouldn't load? Are there other things I can check? Is this a bug in IIS that only affects WS 2008 R2? I've run out of things I know to check for, all evidence suggests it's not an immediate problem with php. Any feedback appreciated.


Thanks in advance.

Timeouts and 500

$
0
0

Hi,

 Did anyone has any experience with this sort of issue?

SQLState: 08S01
Error Code: 258
Message: [Microsoft][SQL Server Native Client 11.0]TCP Provider: Timeout error [258].
SQLState: 08S01
Error Code: 258
Message: [Microsoft][SQL Server Native Client 11.0]Communication link failure
SQLState: 08S01
Error Code: -2147467259

SQL 2008 and IIS7 on Win 2008 with PHP 5.4.13

Often at the same time my own monitoring script test.php I run every 5 min which just runs a simple SELECT to database and returns 200 returns 500 instead. However there are always more 500's than errors shown above in PHP error log.

I do not have much help from sysadmins/dba's with this setup and any suggestions on how to pinpoint and fix this problem will be appreciated a lot.

I would also love to learn how I can trace 500 details on IIS. I see suggestions how to enable detailed output to a 500 page but I do want to capture it in some sort of log file or event log on Windows.

Thank you


500 Internal Server Error When Running WordPress (PHP) from CIFS

$
0
0

We are attempting to move our load balanced system to using a CIFS (UNC) share for the content. When a WordPress site runs from a local drive (shared by the servers using the MelioFS, which has it's own issue and hence why we are moving away from it) we can update plugins via the GUI of WordPress. When we move to the CIFS we get a 500 Internet Server Error only when trying to do the plugin updates. The rest of the site functions normally as far as we can tell. There is nothing in the PHP log to help identify the error but we do see in the Windows Event Viewer these two errors:

1. Application Error Event ID 1000:

Faulting application php-cgi.exe, version 5.3.24.0, time stamp 0x51659439, faulting module MSVCR90.dll, version 9.0.30729.4148, time stamp 0x4a594c79, exception code 0xc0000006, fault offset 0x0003afac, process id 0x1104, application start time 0x01ce6dff71826b75."

2. Application Error Event ID 1005:

Windows cannot access the file  for one of the following reasons:  there is a problem with the network connection, the disk that the file is stored on, or the storage  drivers installed on this computer; or the disk is missing.  Windows closed the program CGI / FastCGI because of this error.

Program: CGI / FastCGI

File:

The error value is listed in the Additional Data section.

User Action

1. Open the file again.  This situation might be a temporary problem that corrects itself when the program runs again.

2.  If the file still cannot be accessed and

- It is on the network,  your network administrator should verify that there is not a problem with the network and that the server can be contacted.

- It is on a removable disk, for example, a floppy disk or CD-ROM, verify that the disk is fully inserted into the computer.

3. Check and repair the file system by running CHKDSK. To run CHKDSK, click Start, click Run, type CMD, and then click OK. At the command prompt, type CHKDSK /F, and then press ENTER.

4. If the problem persists, restore the file from a backup copy.

5. Determine whether other files on the same disk can be opened. If not, the disk might be damaged. If it is a hard disk, contact your administrator or computer hardware vendor for  further assistance.

Additional Data

Error value: C000020C

Disk type: 0

 

Has anyone run into this issue and found a solution? This is all on a Windows Server 2008 Enterprise Edition Service Pack 2 system running IIS 7 with PHP 5.3.24.

Unable to get PHP working with IIS7

$
0
0

I just tried to install PHP with IIS and am unable to get it to work.

My problem is that the PHP script portion of my webpage is not executed when I browse my simple test webpage from IIS manager. If I show the page source, the PHP script is displayed which, as I understand it, means the web server is not processing the script. The non-PHP portion of the webpage is correctly displayed.

If I extract the PHP script portion from the webpage, and paste it into a PHP file, I can successfully execute that script from the DOS command prompt so I assume the PHP syntax is correct.

This is the first time I've tried to create a website so it is possible I've missed some obvious steps but have been unable to solve this with what I've found so far on various forums.

I did try to install PHP using the MS Web Platform Installer but I did not discover that method until I had installed PHP on its own so it is possible that I've installed something in the wrong order. I've tried to pull everything out and reinstall it but that hasn't worked.

Here are more details:

Contents of iisstart.htm
<!DOCTYPE html>
<html>
<body>
test

<?php
echo "My first PHP script!";
?>
</body>
</html>

Version Information:
Windows 7 Version 6.1 Build 7601 SP1
IIS Version 7.5.7600.16385
PHP version 5.4.17

Control Panel Windows Features

Under Internet Information Services->World Web Services->Application Development Features, the following are turned on:  .NET Extensibility, CGI

IIS FastCGI Settings
Full path is "C:\Program Files (x86)\PHP\v5.4\php_cgi.exe"
Max instances was zero but I changed it to 4
FastCGI Settings are only shown for my computer, not my website, is this correct?

IIS Handler Mappings
These are set at the computer level and inherited by my website.
Request Path:*.php
Module: FastCgiModule
Executable: "C:\Program Files (x86)\PHP\v5.4\php-cgi.exe"
Name: php-5.4.17
Mapping: Invoke handler only if request is mapped to: (this is checked)  File or Folder (this is also checked)
Verbs: One of the following Verbs: GET,HEAD,POST
Access: Script

IIS MIME Types:
These are set at the computer level and inherited by my website.
Extension: .php
MIME Type: application/x-httpd-php

php.ini file
I have PHP manager loaded so if I run IIS manager, click on my website and run PHP Manager, it shows that the php.ini file is being loaded from "C:\Program Files (x86)\PHP\v5.4\php.ini" which is what I expect.

IIS cgi.force_redirect
PHP manager shows cgi.force_redirect set to 0 for both the local and master value.

Again, any help you can provide will be very appreciated!

Hello

$
0
0

Hello all!

I'm new in this community and I'm here to learn more about PHP and other things. Hope to see you guys here. Thanks!

PHP 5.3+ not connecting to MySQL db (which is a separate server, this isn't a localhost issue)

$
0
0

We have an IIS7 web server that has PHP 5.2.14 installed, and we've also installed PHP 5.3.13 and PHP 5.5.0.  Server is Windows Server 2008, SP2

We are testing with a simple test script and have confirmed that for some reason, PHP 5.3.13 and 5.5 cannot connect to MYSQL (the MySQL database server is specified as an IP address, not a hostname or localhost).  So far every forum or blog post I've found regarding PHP 5.3+ not connecting to MySQL has been about disabling ipv6, but this isn't our issued (and anyway it's already disabled in the NIC and in the Windows hosts file)

As far as I can tell we have all the correct configuration in place. All versions work with a phpinfo test page (no errors), and they all appear to show that MySQL support is enabled on the phpinfo page.

Each version is using its own php.ini file.

There are no errors when I run this:

c:\>"C:\Program Files\PHP\v5.3\php-cgi.exe" -v
PHP 5.3.13 (cgi-fcgi) (built: May 8 2012 18:43:22)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

c:\>

But when I run php-cgi.exe against a simple test script (that works fine in php 5.2) it won't connect:

--

c:\Program Files\PHP\v5.3>php-cgi.exe d:\xxxxxxxx\dbtest.php
X-Powered-By: PHP/5.3.13
Content-type: text/html

Could not connect

--

Here is the MySQL section from phpinfo:

MySQL Supportenabled
Active Persistent Links0
Active Links0
Client API versionmysqlnd 5.0.8-dev - 20102224 - $Id: 65fe78e70ce53d27a6cd578597722950e490b0d0 $

Can anyone provide any advise or further troubleshooting steps?

Thank you

IIS + PHP Site not displaying correctly

$
0
0

I have a php website that I've been running on an OLD version of Windows. I am trying to migrate it to a Windows Server 2008 64bit but not having any luck.

PHP is installed and running correctly as when I do the php info file, all the information is displayed.

Here is a print screen of what appears:

==

'); define('_MOBILEGEAR_CATTITLE','Mobile Gear'); define('_MOBILEGEAR_CATBLURB','

Some text

'); define('_SUBSEA_CATTITLE','Subsea Telecom'); define('_SUBSEA_CATBLURB','

more text

===

Essentially it looks like the site and sub menu pages are all being displayed on one page and compressed together.

Any ideas?


Thanks

 

PHP 5.3+ not connecting to MySQL db (which is a separate server, this isn't a localhost issue)

$
0
0

We have an IIS7 web server that has PHP 5.2.14 installed, and we've also installed PHP 5.3.13 and PHP 5.5.0.  Server is Windows Server 2008, SP2

We are testing with a simple test script and have confirmed that for some reason, PHP 5.3.13 and 5.5 cannot connect to MYSQL (the MySQL database server is specified as an IP address, not a hostname or localhost).  So far every forum or blog post I've found regarding PHP 5.3+ not connecting to MySQL has been about disabling ipv6, but this isn't our issued (and anyway it's already disabled in the NIC and in the Windows hosts file)

As far as I can tell we have all the correct configuration in place. All versions work with a phpinfo test page (no errors), and they all appear to show that MySQL support is enabled on the phpinfo page.

Each version is using its own php.ini file.

There are no errors when I run this:

c:\>"C:\Program Files\PHP\v5.3\php-cgi.exe" -v
PHP 5.3.13 (cgi-fcgi) (built: May 8 2012 18:43:22)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

c:\>

But when I run php-cgi.exe against a simple test script (that works fine in php 5.2) it won't connect:

--

c:\Program Files\PHP\v5.3>php-cgi.exe d:\xxxxxxxx\dbtest.php
X-Powered-By: PHP/5.3.13
Content-type: text/html

Could not connect

--

Here is the MySQL section from phpinfo:

MySQL Supportenabled
Active Persistent Links0
Active Links0
Client API versionmysqlnd 5.0.8-dev - 20102224 - $Id: 65fe78e70ce53d27a6cd578597722950e490b0d0 $

Can anyone provide any advise or further troubleshooting steps?

Thank you

PHP Errors not showing up in event viewer

$
0
0

The appropriate php.ini settings are set:

log_errors = On

error_log = syslog

However, errors are not being logged in Event Viewer -> Windows Logs -> Application.

I tried a few different things. If I run the php script containing the error from the command line then the error is written to the Event Viewer, no problem. If I substitute the error_log setting with a path like C:/temp/error.log then IIS will write the error to the file.

How do I make error_log = syslog work so that IIS logs PHP errors in the event viewer? I'm hoping it's a simple switch or button I'm missing.

Version Info: IIS 7.5 and PHP 5.5.


PHP can create files but not delete them

$
0
0

I'm trying to install some mail marketing software from Interspire. It's giving me a permissions error. It looks to me that the correct users have all the proper errors. However, it's popping up with an error saying it doesn't have proper permissions. After digging through the files I pinpointed the files and here's what I found. PHP can create and write to the files, but cannot delete them. What do I need to do to set permissions properly. Note if I create a file in the folder manually, I can delete it from PHP, it's only files PHP creates that it connot delete.

FAST_CGI issue in IIS6 Windows server 2003

$
0
0

HI All,

My PHP application sutuped using FastCGI/IIS6/Windows server 2003.

Some times the site going to hung state, taking so much time to process the request.

That time I logged with server and checked the process in Task manager, there was so many fast_cgi.exe process are running (max 30 to 80).

I don't know why it occurring like that.below is my fast cgi settings

[PHP]
ExePath=C:\PHP\php-cgi.exe
InstanceMaxRequests=10000
ActivityTimeout=600
RequestTimeout=600
EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000,PHPRC:C:\PHP\

Please advice me how to fix this issue.

Thanks,
Suresh

runing powershell script from php: access deny for stop-process

$
0
0

Hello

On a 2K8R2 server with IIS 7.5, I have a small powershell script that restarts a program. To achieve that, I check if the program is already runing on the server, I kill it , and start it again:

if (Get-Process myprogram) { # checks if the program is runing
 Get-Process myprogram | Stop-Process # kill the program
 [Diagnostics.Process]::Start('E:\myprogram.bat','')
}
else {
 [Diagnostics.Process]::Start('E:\myprogram.bat','')
}

Runing it from an msdos console works fine:

powershell -command e:\mypsscript.ps1

I would like to make a web interrface in PHP 5.4.12 (x64), which would launch this script pressing a button:

$cmd = 'powershell -command e:\mypsscript.ps1 < NUL';
	if ( $a = shell_exec($cmd) ) {
		echo "<span style='color:blue;'>$a</span><br/><br/>";
	}

The PHP page calls my powershell script, but it seems I have some permissions problem, the script returns: 

can't stop process: access denied.

I tried to run the application pool of my site as the local administrator and localsystem, but it's still the same .

How can I solve my permission issue ?

thank you for your advice!


PHP-ISS installation error

$
0
0

Hi,

I am new to PHP and IIS. I tried to install PHP on my system and run a sample program. I created map handler as required for PHP. However I am facing the following error. I tried all possible combinations given in various posts.

The error seems to be with MSVCR110.DLL.  From process monitor tool I noted the attached access error for this dll. I have admin access and has all access for this Dll. Yet, its giving access denied message.

Can some one please help me how to deal with this DLL file error.

Thanks

Subbu Ambati

 

Error

PHP 5.5 Install from the Web PI

$
0
0

Does anyone know when PHP 5.5 will be available for install from the Web PI?

Viewing all 260 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>