This topic is locked
[SOLVED]

 Connection Problems

2/23/2008 8:18:35 AM
PHPRunner General questions
S
swanside author

Hi all,
I have had to reconfigure the works server, It is running the following
IIS v5.1

PHP Version 5.2.5 which was the installer version

MySQL v 5.0.51 a-community-nt via TCP/IP
When I build my project and run it I get this error
Fatal error: Call to undefined function mysql_connect() in C:\Documents and Settings\Paul\My Documents\PHPRunnerProjects\Project1\output\include\dbconnection.php on line 9
Any Ideas please?
Thanks

Paul.

J
Jane 2/26/2008
S
swanside author 2/27/2008

Thanks Jane, I got it installed, but another problem has arisen now, maybe you have come across this before or somebody else has. I run my phprunner, connect to my database and build the project. I select to view in browser and I get a error like this
PHP error happened

Error Type; 2

Error description; fopen(templates_c\wrt47c5cf16302d6) [function.fopen]: failed to open stream: Permission denied

URL; localhost/php/menu.php?

Error file C:\Inetpub\wwwroot\php\libs\internals\core.write_file.php

Error line 32
This is the details of the core.write_file.php

<?php

/**

* Smarty plugin

* @package Smarty

* @subpackage plugins

*/
/**

* write out a file to disk

*

* @param string $filename

* @param string $contents

* @param boolean $create_dirs

* @return boolean

*/

function smarty_core_write_file($params, &$smarty)

{

$_dirname = dirname($params['filename']);
if ($params['create_dirs']) {

$_params = array('dir' => $_dirname);

require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php');

smarty_core_create_dir_structure($_params, $smarty);

}
// write to tmp file, then rename it to avoid

// file locking race condition

$_tmp_file = tempnam($_dirname, 'wrt');
if (1 /*!($fd = @fopen($_tmp_file, 'wb'))*/) {

$_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt');

if (!($fd = @fopen($_tmp_file, 'wb'))) {

$smarty->trigger_error("problem writing temporary file '$_tmp_file'");

return false;

}

}
fwrite($fd, $params['contents']);

fclose($fd);
// Delete the file if it allready exists (this is needed on Win,

// because it cannot overwrite files with rename()

if (file_exists($params['filename'])) {

@unlink($params['filename']);

}

@rename($_tmp_file, $params['filename']);

@chmod($params['filename'], $smarty->_file_perms);
return true;

}
/* vim: set expandtab: */
?>


Thanks for any light you can put on this
Paul.

Alexey admin 2/28/2008

Paul,
you need to grant Full Control permissions on C:\Inetpub\wwwroot\php\templates_c folder to IUSR_... user or to Everyone.

S
swanside author 2/28/2008

That works. Thankyou very much for your help.
Paul.