Forum

Thread tagged as: Problem

Creating new page - 'Sorry, that page could not be created'

Hi,

I have created a page manually in gallery/case-studies/index.php. It exists on the server, and when logged into Perch on the host server, I attempt to create a page called Case Studies (having the slug case-studies) as a subpage of Gallery with instructions that this page will have pages below it (to ensure it is located in a folder with the slug name as the file index.php). I get the message:

Sorry, that page could not be created.

Any tips?

Here is the output of my Diagnostics:

HOSTING SETTINGS

PHP: 5.4.4-14+deb7u9
Zend: 2.4.0
OS: Linux
SAPI: apache2handler
Safe mode: not detected
MySQL client: 5.5.37
MySQL server: 5.5.37-0+wheezy1
Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bcmath, bz2, calendar, ctype, dba, dom, hash, fileinfo, filter, ftp, gettext, SPL, iconv, json, mbstring, session, posix, Reflection, standard, shmop, SimpleXML, soap, sockets, Phar, exif, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, zip, apache2handler, PDO, gd, mcrypt, mysql, mysqli, pdo_mysql, ssh2, mhash
GD: Yes
ImageMagick: No
PHP max upload size: 10M
PHP max form post size: 8M
PHP memory limit: 128M
Total max uploadable file size: 8M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No

Thanks in advance

Adam

Adam Menczykowski

Adam Menczykowski 1 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

If you've created it manually and then try to create it again, you'll get problems.

Ah ok, I see! Thanks a lot.

But why...?

Is it so hard to say "if this file/folder exists dont create it just add it to the database, if not then create it and add it to the database.". Here ill even help you out with this Perch.

if(!file_exists("folder")){
  // create directory
  // create index.php inside directory
}
// add page to database