ご回答いただいた通りPHPのバージョンが古かったためでした。
以降同じ問題があった方のために解決までの手順を書かせて頂きます。
⑴PHPのバージョン確認方法
xamppのhtdoc内に以下のコードを入力し、バージョンを確認する
html
1<DOCTYPE html> 2<html> 3<head> 4<meta charset="UTF-8"> 5 6</head> 7<body> 8 9<?php phpinfo() ?> 10 11<body> 12<html> 13
バージョンが古かったので、PHPのみ更新しようと考えましたが、途中で必要なファイルを消してしまったようでxamppを丸ごと更新しました。
xamppのファイルを丸ごとcドライブ直下から移動し、xamppの最新バージョンをcドライブ直下にインストールしました。
その後、https://tabibitojin.com/pc-xampp-wordpress-install/のサイトを参考にしたところ無事wordpressに接続できました。
ネットでwordpressについて学習しようと思い、作業していましたが、wordpressのインストール画面で躓いてしまいました。
非常に初歩的な質問で申し訳ないのですが、よろしくお願い致します。
OSはWindows10を使用しております。
以前PHPの学習でxamppをダウンロードしていたため、xamppのダウンロードと使用はできる状態であると思います。
Wordpressを使用するため、公式サイトよりDLして、フォルダ内のhtdoc直下にwordpressという名前で設置しました。
その後ApacheとMysqlを起動して、http://localhost/wordpress/というアドレスを入力しました。
しかし、
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in C:\xampp\htdocs\wordpress\wp-includes\functions.php on line 1081
というエラーが出てしまいます。
解決できず先に進めず困っています。どうかお力添えお願いいたします。
html
1 2function add_query_arg( ...$args ) { ←これが1081行目です。 3 if ( is_array( $args[0] ) ) { 4 if ( count( $args ) < 2 || false === $args[1] ) { 5 $uri = $_SERVER['REQUEST_URI']; 6 } else { 7 $uri = $args[1]; 8 } 9 } else { 10 if ( count( $args ) < 3 || false === $args[2] ) { 11 $uri = $_SERVER['REQUEST_URI']; 12 } else { 13 $uri = $args[2]; 14 } 15 } 16
追記
PHPとmysqlのバージョンについて補足です。
PHP Version 5.4.7
wordpress Version 5.4
一応1081行目以前のコードも記載いたします。
html
1foreach ( (array) $data as $k => $v ) { 2 if ( $urlencode ) { 3 $k = urlencode( $k ); 4 } 5 if ( is_int( $k ) && null != $prefix ) { 6 $k = $prefix . $k; 7 } 8 if ( ! empty( $key ) ) { 9 $k = $key . '%5B' . $k . '%5D'; 10 } 11 if ( null === $v ) { 12 continue; 13 } elseif ( false === $v ) { 14 $v = '0'; 15 } 16 17 if ( is_array( $v ) || is_object( $v ) ) { 18 array_push( $ret, _http_build_query( $v, '', $sep, $k, $urlencode ) ); 19 } elseif ( $urlencode ) { 20 array_push( $ret, $k . '=' . urlencode( $v ) ); 21 } else { 22 array_push( $ret, $k . '=' . $v ); 23 } 24 } 25 26 if ( null === $sep ) { 27 $sep = ini_get( 'arg_separator.output' ); 28 } 29 30 return implode( $sep, $ret ); 31} 32 33 34/** 35 * Retrieves a modified URL query string. 36 * 37 * You can rebuild the URL and append query variables to the URL query by using this function. 38 * There are two ways to use this function; either a single key and value, or an associative array. 39 * 40 * Using a single key and value: 41 * 42 * add_query_arg( 'key', 'value', 'http://example.com' ); 43 * 44 * Using an associative array: 45 * 46 * add_query_arg( array( 47 * 'key1' => 'value1', 48 * 'key2' => 'value2', 49 * ), 'http://example.com' ); 50 * 51 * Omitting the URL from either use results in the current URL being used 52 * (the value of `$_SERVER['REQUEST_URI']`). 53 * 54 * Values are expected to be encoded appropriately with urlencode() or rawurlencode(). 55 * 56 * Setting any query variable's value to boolean false removes the key (see remove_query_arg()). 57 * 58 * Important: The return value of add_query_arg() is not escaped by default. Output should be 59 * late-escaped with esc_url() or similar to help prevent vulnerability to cross-site scripting 60 * (XSS) attacks. 61 * 62 * @since 1.5.0 63 * @since 5.3.0 Formalized the existing and already documented parameters 64 * by adding `...$args` to the function signature. 65 * 66 * @param string|array $key Either a query variable key, or an associative array of query variables. 67 * @param string $value Optional. Either a query variable value, or a URL to act upon. 68 * @param string $url Optional. A URL to act upon. 69 * @return string New URL query string (unescaped). 70 */ ←1080行目
回答2件
あなたの回答
tips
プレビュー