• yo.

    using a free host. i know this is trouble.

    setup mysql database, setup config file, uploaded it all onto a fresh hosting account.

    directed to wp-admin/install.php … error:

    “Parse error: syntax error, unexpected $end in /home/twist/public_html/wp-config.php on line 1”

    i know this may be a hack but the account with the host company is fresh. i get hacked b4 i even get to the install.php bit??? i checked the index.php file, no code injected. no unwanted spaces or linebreaks. i don’t get it. i have tried several free hosts tonight and they all give me the same line 1 error. simply can’t believe i get hacked everytime as soon as i upload the files.

    help, much love.
    twist

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi Twist

    You probably have a blank line at the begining of the wp-config.php hence the error at line 1.

    It should be <?php

    Delete any blank spaces at the top and bottom and try again.

    theres no probably about it.

    in editing the wp-config.php you added linebreaks or “hidden crap” before the opening <?php in your wp-config.php

    and, if you are using the latest version of wordpress, there is NO closing ?>, as was suggested above.

    Thread Starter twistbeats

    (@twistbeats)

    sorry guys. i can’t see any spaces/line breaks at top or bottom of the config file.

    actually, I misread this last night, and the hidden stuff problem probably is not the case here.

    about the only thing I might suggest without seeing the file, is putting back in the no-longer-included closing php tag:

    Use a plain text editor.

    Take your cursor and put it after the last character on the last line of your wp-config.php

    Hit the enter key- you’ll be on the next line.

    Type ?>

    DO NOT hit enter again, dont scroll down the file, dont do anything except save and close the file, upload it, and try again.

    If that doesnt work, I would need to see the contents of the file.

    Thread Starter twistbeats

    (@twistbeats)

    cool. but now i get this:

    Fatal error: Call to undefined function is_admin() in /home/twist/public_html/wp-admin/includes/comment.php on line 162

    any thoughts?

    Thread Starter twistbeats

    (@twistbeats)

    ok, that last error has gone away. not sure why. but i’m back to the initial line 1 parse error.

    interestingly i have noticed this:

    the original config file i used to upload, displays the code on 76 lines. once uploaded, i download it and find that the format of the code is thus that it is all displayed on one line (line 1). if you know what i mean. is this normal?

    Thread Starter twistbeats

    (@twistbeats)

    here is the code (not including db password)

    <?php/** * The base configurations of the WordPress. * * This file has the following configurations: MySQL settings, Table Prefix, * Secret Keys, WordPress Language, and ABSPATH. You can find more information by * visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing * wp-config.php} Codex page. You can get the MySQL settings from your web host. * * This file is used by the wp-config.php creation script during the * installation. You don’t have to use the web site, you can just copy this file * to “wp-config.php” and fill in the values. * * @package WordPress */// ** MySQL settings – You can get this info from your web host ** ///** The name of the database for WordPress */define(‘DB_NAME’, ‘twist_wordpress’);/** MySQL database username */define(‘DB_USER’, ‘twist_twist’);/** MySQL database password */define(‘DB_PASSWORD’, ‘passwordhere’);/** MySQL hostname */define(‘DB_HOST’, ‘localhost’);/** Database Charset to use in creating database tables. */define(‘DB_CHARSET’, ‘utf8’);/** The Database Collate type. Don’t change this if in doubt. */define(‘DB_COLLATE’, ”);/**#@+ * Authentication Unique Keys. * * Change these to different unique phrases! * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service} * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. * * @since 2.6.0 */define(‘AUTH_KEY’, ‘put your unique phrase here’);define(‘SECURE_AUTH_KEY’, ‘put your unique phrase here’);define(‘LOGGED_IN_KEY’, ‘put your unique phrase here’);define(‘NONCE_KEY’, ‘put your unique phrase here’);/**#@-*//** * WordPress Database Table prefix. * * You can have multiple installations in one database if you give each a unique * prefix. Only numbers, letters, and underscores please! */$table_prefix = ‘wp_’;/** * WordPress Localized Language, defaults to English. * * Change this to localize WordPress. A corresponding MO file for the chosen * language must be installed to wp-content/languages. For example, install * de.mo to wp-content/languages and set WPLANG to ‘de’ to enable German * language support. */define (‘WPLANG’, ”);/* That’s all, stop editing! Happy blogging. *//** WordPress absolute path to the WordPress directory. */if ( !defined(‘ABSPATH’) ) define(‘ABSPATH’, dirname(__FILE__) . ‘/’);/** Sets up WordPress vars and included files. */require_once(ABSPATH . ‘wp-settings.php’);

    thats your editing and ftping. and thats also why the error shows up on line 1.

    if you want, email me your wp-config.php and ill make a new one for you that works, and send it it back to you.

    whoo ATTTT village-idiot.org —

    be patient though, my email server is slow as molasses.

    ok, so he never came back to say if this worked so I’ll assume no news really is good news πŸ™‚

    Thread Starter twistbeats

    (@twistbeats)

    well… now im getting a new error:

    Parse error: syntax error, unexpected T_FUNCTION in /home/twist/public_html/wp-admin/includes/comment.php on line 1

    sent the comments file.

    Thread Starter twistbeats

    (@twistbeats)

    I’M IN!!!!!

    Many many thanks to whooami.

    i think this is what was the problem.

    my php code was being rendered onto one line. this affected the wp_config.php file as well as the comments.php file. by using the xpanel file manager to upload these 2 files again (instead of my usual ftp client: cyberduck) the problem has gone.

    STRANGE!!!!

    I have the same problem! And I can not solve it!

    I got:
    Fatal error: Call to undefined function is_admin() in /home/a7725460/public_html/wordpress/wp-admin/includes/comment.php on line 162

    But I try to upload the files by a different way (Not filezilla) as I usually do, but it doesnt work!

    Do you have any idea of what I can do?

    Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘newbie, can’t install, parse error’ is closed to new replies.