简体   繁体   中英

Installing Composer on CentOS fails

I get the following error:

[ErrorException] preg_replace_callback(): Compilation failed: assertion expected after (?( at offset 36

And no idea what it means.

I also get the same error on CentOS 5.10. You should try to install an older version. Version 1.0.0 worked for me:

    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
    php composer-setup.php -- --version=1.0.0
    php -r "unlink('composer-setup.php');"

This isn't really an answer, but what I needed was only a specific library Composer installs. So i got that.

I'll be switching from CentOS to RedHat within the next few months, on new servers so that should make it easier as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM