PDA

Prikaži potpunu verziju : Parse error: syntax error - Šta da promenim?


milosh-96
27.7.2011, 20:19
Imam problem sa ovim PHP-om, WordPress izbacuje je sledeću poruku:
Parse error: syntax error, unexpected T_REQUIRE in /home/vol14/hyperphp.com/hp_7744873/htdocs/wp-content/plugins/footballsoccer-league-tables/footbo-pull.php on line 18
Evo šta piše u tom redu 18:
require 'pull.inc.php';

EclipsE
27.7.2011, 20:53
Imam problem sa ovim PHP-om, WordPress izbacuje je sledeću poruku:
Parse error: syntax error, unexpected T_REQUIRE in /home/vol14/hyperphp.com/hp_7744873/htdocs/wp-content/plugins/footballsoccer-league-tables/footbo-pull.php on line 18
Evo šta piše u tom redu 18:
require 'pull.inc.php';


Nije tu greska, daj pocetak koda do te linije.

milosh-96
28.7.2011, 14:27
evo
<?php

//--------------------------------------------------------------
// -------------------------------------------------------------

function pull($type, $name) {

// LEAGUE
if($type == 'league') {
$infos['url'] = 'http://www.footbo.com/Competitions/' . $name;
// check cache before do a request
if ( false === ( $html = get_transient( $type . '_' . $name ) ) ) {
$html = my_curl($infos['url']);
if(!empty($html) && $html != null && $html != false)
// set cache
set_transient($type . '_' . $name, $html, 60 * (int) get_option('footbo-field-cache'));
}

e samo da te pitam, da li znaš zbog čega je ova greška?
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in /home/vol14/hyperphp.com/hp_7744873/htdocs/wp-content/plugins/leaguemanager/admin/admin.php on line 1410

EclipsE
28.7.2011, 15:02
Fale 2 zagrade:

set_transient($type . '_' . $name, $html, 60 * (int) get_option('footbo-field-cache'));
}

treba

set_transient($type . '_' . $name, $html, 60 * (int) get_option('footbo-field-cache'));
}
}
}

e samo da te pitam, da li znaš zbog čega je ova greška?
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in /home/vol14/hyperphp.com/hp_7744873/htdocs/wp-content/plugins/leaguemanager/admin/admin.php on line 1410

PHP-u je dato samo 32 MB memorije. Mozes da promenis ini fajl, ili da odradis sledece na pocetku koda:

ini_set('memory_limit', '128M');

milosh-96
28.7.2011, 15:34
jel ovako treba:
ini_set('memory_limit', '128M');
<?php

/**
* Admin class holding all adminstrative functions for the WordPress plugin LeagueManager
*
* @author Kolja Schleich
* @package LeagueManager
* @copyright Copyright 2009
*/

class LeagueManagerAdminPanel extends LeagueManager
{
/**
* load admin area
*
* @param none
* @return void
*/
function __construct()
{
require_once( ABSPATH . 'wp-admin/includes/template.php' );


slučajno sam ti dao kod iz pogrešnog PHP fajla u postu #3, ovo je kod do linije 18
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf35 0
{\fonttbl\f0\fmodern\fcharset0 Courier;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww 11800\viewh9820\viewkind0
\deftab720
\pard\pardeftab720\ql\qnatural

\f0\fs24 \cf0 <?php\
/*\
Plugin Name: Football/Soccer League Tables\
Plugin URI: http://footballteamnews.info\
Description: Football/Soccer League Tables grabs the latest football Tables from footbo.com and post them into your wordpress website/blog.\
Version: 2.0\
Author: B Apps\
License: GPL2\
*/\
\

EclipsE
28.7.2011, 16:00
jel ovako treba:
ini_set('memory_limit', '128M');
<?php

/**
* Admin class holding all adminstrative functions for the WordPress plugin LeagueManager
*
* @author Kolja Schleich
* @package LeagueManager
* @copyright Copyright 2009
*/

class LeagueManagerAdminPanel extends LeagueManager
{
/**
* load admin area
*
* @param none
* @return void
*/
function __construct()
{
require_once( ABSPATH . 'wp-admin/includes/template.php' );



Ne vec stavis posle <?php.

slučajno sam ti dao kod iz pogrešnog PHP fajla u postu #3, ovo je kod do linije 18
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf35 0
{\fonttbl\f0\fmodern\fcharset0 Courier;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww 11800\viewh9820\viewkind0
\deftab720
\pard\pardeftab720\ql\qnatural

\f0\fs24 \cf0 <?php\
/*\
Plugin Name: Football/Soccer League Tables\
Plugin URI: http://footballteamnews.info\
Description: Football/Soccer League Tables grabs the latest football Tables from footbo.com and post them into your wordpress website/blog.\
Version: 2.0\
Author: B Apps\
License: GPL2\
*/\
\

Riiight... To lici na RTF, uploaduj fajl ako mozes.

milosh-96
28.7.2011, 16:04
ovo "fatal error..." sam rešio, ali mi se sad pojavila ova poruka:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /home/vol14/hyperphp.com/hp_7744873/htdocs/wp-admin/includes/upgrade.php on line 884
pkušao sam sa da ubacim ovo za memoriju ali neće
evo, u rar-u je

dare023
28.7.2011, 17:38
Povećaj memory limit u php.ini