I have a WP problem, namley, I tried uploading a new theme in the dashboard and got this error:
The uploaded file exceeds the upload_max_filesize directive in php.ini.
googled it, possible solutions:
however:
can’t find php.ini anywhere in my computer
don’t have access to edit .htaccess file… have tried before… (have been advised here on SP PHP forum to never edit this file…
did what it said for wp-config.php file (added that code they say at bottom of it), but that did not solve problem (do I have to restart the server for that to work? I never turned Apache Server off and on… I don’t even need to turn it on when I restart my machine…)
when googled this it said this is a common error in WP… maybe these files should come with higher filesize limits out of the box, then, no???
thank you for your response… my mac came with php installed… I didn’t have to install it…
I searched for it in the HD (i.e., entire computer), I didn’t find it… I don’t know where PHP is installed… so whether or not WP dashboard accepts this theme depends on this PHP config file that actually is not part of WP? hmmm…
Next, right click on the Finder icon at the bottom of your Dock.
From the context menu, click on Go to Folder...
When the search bar drops down, type /etc/ into the search bar.
Then click on the Go button on the right corner of the search bar.
Once in the /etc/ folder, scroll down until you find php.ini.default.
Create a backup of that file by copying php.ini.default and pasting it inside /etc/. This may require your password.
Once you have created an extra copy of php.ini.default, go a head and rename the copy to php.ini.back.default. Again, this may require your password.
Once you are finished with backing up the php.ini.default file, remove the .default extension and just have php.ini. Again, this may require your password.
After this, this should allow you to use the php.ini file. Though I highly suggest you upgrade your PHP and take advantage of PHP 7.
Here is a tutorial I made on how to do so. I am planning on making more for all versions of Mac, Windows, and Linux. Even though it is listed as El Capitan, it virtually works on all Mac versions. There is only a few slight difference in things, roughly on the SSL part.
I don’t know about macs, but for Windows I sometimes need to “edit as administrator” and turn off the service so that it isn’t “currently open in another program” in order to edit some files.
If you don’t have permissions, you’ll have to rename them in the terminal. This may take a bit since you don’t have a graphical interface to work with. Most people prefer a graphical interface. Also, that isn’t the correct permissions. 644 is not a usable permission. There are far too much things behind permissions that I don’t want to get into since this is just for solving php.ini.
To make sure that it restarted without a problem, I suggest doing
sudo apachectl configtest
If there are any problems/errors, configtest will tell you what file and what line the problem is on. I usually restart my Apache after I make changes to my php.ini file and my httpd.conf file.
With the output, scroll down to “Loaded Configuration File” and check that the copy of php.ini that you think is the one that you need to edit actually is the one that you need to edit
well, I’m learning WP, I want to learn everything properly; I looked up how to install a theme that does not appear in your dashboard when you go to change themes; this is the proper way to do it… hit “upload” button, choose file in your computer where the theme is (that I downloaded from online, it’s a zip file, you’re supposed to upload this zip file to your dashboard…) in WP, if you do “by hand” things you should do thru the interface there are more possibilities things can go wrong down the line…
but I guess you’re right, I could try that (“themes” dir in the WP site, yes? ;~)
thank you, spaceshiptrooper I finally got it to work, BUT:
when I typed sudo apachectl configtest I got this prompt:
Could not reliably determine the server's fully qualified domain name, using <myCompName>.local for ServerName
however, it still worked – I was finally able to upload my theme, HOWEVER:
it said it needs my FTP info, the WP dashboard (or CP, as some would call it), said:
To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed.
but I’m only working locally!! I’m just learning WP… I don’t have any site up online, or a domain, or webhosting set… man, what a pain… well, I suppose this is for the WP forum… oh brother… I have been hand-coding (HTML, JS, CSS, PHP…) for the longest time… I’m having a hard time with WP, I hate to work with blog-editing or WYSIWYG systems, but I have to learn it in order to be able to get more freelance gigs (I’m retired now, and where I live people like to have their websites done in WP…)
ok… thank you very much for your help and to everyone who responded…
The message from configtest is from httpd.conf. it isn’t really required. It’s just telling you that the default domain isn’t set. That’s about it. It doesn’t really hurt your environment or development experience.
As for the FTP part, why don’t you just copy and paste the theme into the Themes folder? Is this message coming from a theme you already are using? If it is, then this problem resides in WordPress and not PHP.