下記のようにしてwordpressにupdate_post_metaで上書き投稿したいのですが、
$shikikin="1ヶ月"とするとAllowed memory sizeエラーになってしまいます。
$shikikin="0"とするとエラーも出ずに投稿できますので、原因はテキスト内容のように思えるのですが、他の項目は登録できているので根本的な問題は別にあるように思います。
php.iniはmemory_limit = 256Mにしているので問題ないかと思います。
考えられる原因等アドバイス頂けると幸いです。
よろしくお願いいたします。
##ソースコード
$my_post = array( 'post_title' => 'ライオンズマンション', 'post_status' => 'publish', 'post_type' => rent, 'post_name' => '111111', ); $insert_id = wp_insert_post($my_post); $shikikin="1ヶ月"; echo "メモリ使用量=" . memory_get_usage(false); //4MBくらいです update_post_meta($insert_id, shikikin, $shikikin);
##エラー内容
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 78 bytes) in~
##php.ini
memory_limit = 256M
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。