I've got problems with my php configuration, everytime I do a post method it doesnt work on the server, for example like create a folder or upload an image,
I've checked the permissions, I've changed them even to 777, I've changed the owner, but it doesnt work
Something imortant: there is no error no where that can give me a clue, so I dont know how can I know what is it...
If some one can help me pls
PHP problems!!!!!!!
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Post your code. Run the following in a new file and tell us the results please.
Code: Select all
<?php
$neg = array('off', 0, false, '', null);
$flags = array(
'Register Globals' => 'register_globals',
'Short Tags' => 'short_open_tag',
'Display Errors' => 'display_errors',
'Magic Quotes GPC' => 'magic_quotes_gpc',
'Magic Quotes Runtime' => 'magic_quotes_runtime',
'Magic Quotes Sybase' => 'magic_quotes_sybase',
);
$ve = phpversion();
$os = PHP_OS;
$er = intval(error_reporting());
foreach ($flags as $n => $v)
{
$flags[$n] = (in_array(strtolower(ini_get($v)), $neg) ? 'Off' : 'On');
}
$cli = (php_sapi_name() == 'cli');
$eol = "\n";
$gle = get_loaded_extensions();
$rows = array();
$le = '';
$wide = 4;
$j = count($gle);
$pad = $wide - $j % $wide;
$len = max(array_map('strlen', $gle));
$func = create_function('$a', 'return str_pad($a, ' . intval($len) . ');');
$gle = array_map($func, $gle);
for($i = 0; $i < $j; $i += $wide)
{
$le .= ' ' . implode(' ', array_slice($gle, $i, $wide)) . $eol;
}
$ec = array(
'E_STRICT' => 2048, 'E_ALL' => 2047, 'E_USER_NOTICE' => 1024,
'E_USER_WARNING' => 512, 'E_USER_ERROR' => 256, 'E_COMPILE_WARNING' => 128,
'E_COMPILE_ERROR' => 64, 'E_CORE_WARNING' => 32, 'E_CORE_ERROR' => 16,
'E_NOTICE' => 8, 'E_PARSE' => 4, 'E_WARNING' => 2, 'E_ERROR' => 1,
);
$e = array();
$t = $er;
foreach ($ec as $n => $v)
{
if (($t & $v) == $v)
{
$e[] = $n;
$t ^= $v;
}
}
if (ceil(count($ec) / 2) + 1 < count($e))
{
$e2 = array();
foreach ($ec as $n => $v)
{
if (!in_array($n, $e) and $n != 'E_ALL')
{
$e2[] = $n;
}
}
$er = $er . ' ((E_ALL | E_STRICT) ^ ' . implode(' ^ ', $e2) . '))';
}
else
{
$er = $er . ' (' . implode(' | ', $e) . ')';
}
if (!$cli)
{
echo '<html><head><title>quick info</title></head><body><pre>', $eol;
}
echo 'PHP Version: ', $ve, $eol;
echo 'PHP OS: ', $os, $eol;
echo 'Error Reporting: ', $er, $eol;
foreach ($flags as $n => $v)
{
echo $n, ': ', $v, $eol;
}
echo 'Loaded Extensions:', $eol, $le, $eol;
if (!$cli)
{
echo '</pre></body></html>', $eol;
}
?>That's the answer
rgds
PHP Version: 5.1.6
PHP OS: Linux
Error Reporting: 2039 ((E_ALL | E_STRICT) ^ E_STRICT ^ E_NOTICE))
Register Globals: On
Short Tags: On
Display Errors: On
Magic Quotes GPC: On
Magic Quotes Runtime: Off
Magic Quotes Sybase: Off
Loaded Extensions:
libxml xml wddx tokenizer
sysvshm sysvsem sysvmsg standard
SimpleXML sockets SPL shmop
session Reflection pspell posix
mime_magic iconv hash gmp
gettext ftp exif date
curl ctype calendar bz2
zlib pcre openssl apache2handler
mysql gd ldap mbstring
mysqli PDO pdo_mysql pdo_sqlite
rgds
PHP Version: 5.1.6
PHP OS: Linux
Error Reporting: 2039 ((E_ALL | E_STRICT) ^ E_STRICT ^ E_NOTICE))
Register Globals: On
Short Tags: On
Display Errors: On
Magic Quotes GPC: On
Magic Quotes Runtime: Off
Magic Quotes Sybase: Off
Loaded Extensions:
libxml xml wddx tokenizer
sysvshm sysvsem sysvmsg standard
SimpleXML sockets SPL shmop
session Reflection pspell posix
mime_magic iconv hash gmp
gettext ftp exif date
curl ctype calendar bz2
zlib pcre openssl apache2handler
mysql gd ldap mbstring
mysqli PDO pdo_mysql pdo_sqlite
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Everah | Please use
And this NOT
Everah | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
No mate safe mode is off
I found something interesting I can do everything from another page and is working perfect, I mean I can create folders and upload images, so from the other one who comes as a pop up is not working maybe is the functions how is implemented and I'm not loading a module in php I attach both codes,
This code works perfect...Code: Select all
function create_folder($folder_name,$dirPath)
{
global $mosConfig_absolute_path;
if(strlen($folder_name) >0)
{
if (eregi("[^0-9a-zA-Z_]", $folder_name)) {
mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], "Directory name must only cont
}
$folder = $mosConfig_absolute_path."/images/stories".$dirPath."/".$folder_name;
if(!is_dir($folder) && !is_file($folder))
{
mkdir($folder,0777);
chmod($folder,0777);
$refresh_dirs = true;
}
}
}Code: Select all
function doCreate($folder) {
global $error;
// initialize context
$path = basePath($folder);
// if Folder does NOT already exist ...
if(!(file_exists(IMAGE_DIR . $path))) {
// ... if Folder does NOT create ...
if(!(@mkdir(IMAGE_DIR . $path, 0777)))
// ... report the error
$error = "Folder \'" . $path . "\' could not be created";
}
// ... otherwise, report the error
else
$error = "Folder \'" . $path . "\' already exists";
}Everah | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]