Menu Editor in Wordpress WP-ADMIN generating error - php

I'm getting the following error when I open the menu editor in the admin options.
The site is on a IIS web server and it's currently using php v5.6.0
So far I have tried the following approaches:
adding define(CONCATENATE_SCRIPTS', false) tag in the wp-config file.
changing the php version on the IIS from 5.6.0 to 7.1.21
I have less than a months working with wordpress and I had never used php before.
--------------------- EDIT ---------------------
It seems the issue might be related to permissions because when I try to access the javascript file which is not missing from the js folder I get the following message:
This is the only file in the folder which I cannot access. I also checked the permissions of the file in the server and it has the same as the other files.

First:
You should post the code which you are using, if you are not using any code, the paste proper screenshots here.
Second:
Its a syntax error which means there's a mistake in your code. So you need to check the code, there's an extra "<" somewhere in the code.

Related

Update PHP File via Wordpress Theme Editor Fails

I'm unable to update PHP code via the WordPress theme editor anymore. When I try to change the functions.php of my child theme with just adding a comment it fails with the following message:
Unable to communicate back with the site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.
I have no idea where to start - can I access a more precise error message somewhere?
Kindly check the permissions of the theme folder, WordPress site must not be able to write the changes in the file. That is why this error is coming.
Hope this helps

Drupal not rendering page content

I'm trying to create a full backup of cyclekids.org. I've backed up all the files, dumped the database, and restored it on another machine (beta.cyclekids.org). However, Drupal doesn't seem to be rendering any page content on the backed-up site. Even pages that 404 on the regular site display the same mostly-blank template with a smattering of content.
What are likely culprits for this (e.g. misdirected theme file or broken config)?
There can be multiple reasons:
First, upload some simple php file containing only php info function (http://php.net/manual/en/function.phpinfo.php), call it and see is everything ok there with the server. I.e. do you have PHP enabled at all. Don't forget to delete that file when it starts working.
If you get php info output that means that php is working. So next problem could be that because of different server settings you are getting php error, but errors are not displayed.
Try finding in your control panel where php settings are and turn off on page error reports.
If you can't find it in control panel, try enabling error reporting from the code: add
error_reporting(E_ALL);
as first function in index.php file in site root.
Check how much memory PHP has available. Upload some php info file to working site and compare difference in their output.

PHP website Warning: require(/../core/database/connect.php): failed to open stream

Hi I want to put my website(web application in PHP) on a server of my school and it’s for a project for school. So I had read the instructions of my school where I had to put my source code. I had to put in a folder called ‘Html’ and according to my school that is used for php hosting. After putting my files in that folder I went to browse to my website.
But it doesn’t show me the website when I browse to it. Instead it had given me a error message, see link below:
http://i.imgur.com/dfYxc02.jpg
After reading the error message I thought it had something to do with this line of code in connect.php file:
mysql_connect('145.92.203.240', 'user', mypassword');
I thought that was looking fine, but I also tried “mysql_connect('localhost, 'user', mypassword');”, but I still receive the same error message.
Furthermore I had tried in “/etc/init.d” to restart apache. For this I used the following command:
apache2 –k restart
But I couldn’t restart apache because I don’t have permission.
I also had tried in “/var/www/localhost/htdocs” to show index.html on the browser. But that didn’t work as wel. I also couldn’t remove te index.html file and replace it with my source code.
Could someone please tell me the solution in steps?
Okay here we go:
You're trying to include a file and the location is wrong
For instance, require('config.php'); will assume the file is in the same folder as the script. require('./folder/config.php'); will assume the file is in the folder. So you may want to check exactly where connect.php is.
The error about include_path
It seems as if you have a var include_path defined somewhere, might want to check that out. If you migrated it, you need to change the var to the new location.

New server - Unable to create wordpress pages - Blank /wp-admin/post.php

Recently I moved a website to a new server. The website was working perfectly on the shared server, but I've encountered a host of permission issues and other problems since relocating to EC2. I have changed the ownership of the /var/www/html folder to apache to allow altering altering of settings on the back end of WordPress. Strangely enough, I am able to create new posts, but when I attempt to update an existing page or create a new one, I receive a blank page. [http://example.com/wp-admin/post/php] Originally I thought it was yet another permission based issue, but after researching that doesn't appear to be the case.
Steps I've taken thus far:
1) Changed ownership of the directory to apache
2) Disabled all my plugins
3) Added : php_flag output_buffering on to .htaccess (Although I wasn't sure if it mattered where in the .htaccess file I should put that command)
From the research I've done it appears that white space after the ?> could be the cause. Anyone know how I could tell which file would have this white space? Several of my files actually do not even have the PHP close tag. One additional note, my previous server was version 5.2.17 to 5.3.20. Any other ideas?
After checking the error logs I discovered that I was missing the mbstring PHP library, which has a function that was called by one of my theme files. Once added I was able to create and alter pages on the backend of WordPress without issue.
To all the folks who get this kind of error of page not displaying must check option.
turn on error reporting if you have commented the lines in your wp-config.php
#ini_set('display_errors','Off');
and than check for error.
if it has the error like this
PHP Warning: Cannot modify header information - headers already sent by (output started at /[server info]/wp-config.php:77)
than check your wp-config.php for extra space at top and bottom of the page.remove extra line spaces even. and than re-upload the wp-config.php.
Most of time this will solve your problem.
Happy Coding!!!!
I had a similar problem and by removing extra spaces before the "< ?php" fixed the issue. Although apparently it was a different theme functions file that was causing the issue. Make sure you look at the php file referenced in the php warning. In this example, it's 'wp-config', but it could be really anything.
PHP Warning: Cannot modify header information - headers already sent by (output started at /[server info]/wp-config.php:77)
Good luck!
Basically this issue happens because you have edited the file directly on cpanel editor or other simple text editor. Just create a new .php file and paste your post.php code in that file. Now save this file and replace this new one with old post.php.

Dreamweaver CS5.5 Dynamically Related Files

I'm trying to use Dreamweaver with an existing code base (not WP, Drupal, or Joomla!) in a PHP/MySQL site. I continue to receive "Dynamically related files could not be found because of an internal server error." I've been googling all day and have read plenty of WP-specific solutions, including the thread on this site. I've tried all the methods listed, no luck.
Setup Info
MAMP 2.0.1
Mac OS X 10.6.8
Dreamweaver CS 5.5
Site's local address: /Users/myName/Sites/siteName
Testing server address: /Applications/MAMP/htdocs/siteName
Attempted solutions:
1) added library to site root (/Users/myName/Sites/siteName/library)
2) added library to MAMP root (/Applications/MAMP/library)
3) added include path for both locations to applied php.ini listed in phpinfo
4) set Dreamweaver to use Site Root paths instead of page-relative paths
5) switched back to page relative paths
6) Restart MAMP, reset ports in Preferences to 8888/8889, or 80/3306
7) checked site info to make sure paths are correctly defined
When I insert the following code, or any require function with a relative path, live view and preview in browser display empty pages.
<?php require_once('includes/initialize.php'); ?>
I'm incredibly frustrated. I had been using XAMPP and a plain text editor for previous work and never had an issue with relative paths. Any help would be appreciated.
Answering my own question; bad form, I'm aware.
EDIT:
Adding to previous list of attempted solutions:
8) tried designating the server ports as 8888/8889 and defining server route as http://localhost:8889/mySite/, like setting up a Drupal/WP/Joomla! testing environment.
9) Uninstalled/Reinstalled MAMP, Dreamweaver, disabled the out-of-the-box Apache server included with OS X, the redefined the site in Dreamweaver.
Fix attempt 8 led to packet error discussed here. Fix attempt 9, plus error reporting that hadn't been working, but did now:
// Report all PHP errors (see changelog)
error_reporting(E_ALL);
showed that the testing server was using the local definition to refer to dynamically related files and, even though that should work, it wasn't working.
After reinstall, created new site with "Site > Manage Sites" and defined Local Site Folder in "Site" menu and the Server Folder in the "Server" Menu as the same directory. (/Applications/MAMP/htdocs/mySite)
Refer to the Setup info in the OP to see my system variables; this may be specific to any/all settings. But only identical local definition and server definition solved the problem. I've recreated previous settings to be sure, and different local/server definitions don't work.
This error can happen with Dreamweaver and PHP sites if the contents of the included file make additional dynamic calls using PHP syntax that Dreamweaver doesn't recognize. Without seeing the contents of initialize.php, I can't be 100% sure this is the case but I am pretty sure that DW is not able to parse the code there and figure out what files to get for display.
Problem Dynamically related files that I see a lot of people run into:
Dreamweaver is scanning whatever is in you Local Copy, it should be a the full installation of WordPress. If you're working locally, download everything on your "Testing server" to your "Local view" in the Files panel.
If you're working with two sets of files, your local copy and what is in MAMP's htdocs or on your "Testing server" should be nearly identical, except for what you're working on of coarse. That's the problem I see people have.
If you're working in kind of "pho-FTP" environment.

Categories