alan grove ….. you have tried plugging other devices to your usb port on your device.. good… it is charging your phone so your usb ports have power. it is not your ps4. i would look at your controller. could be the charging port on your device or your battery. to troubleshoot further, have you tried connecting your controller to your pc to see if your pc recognizes the controller? do the inputs work on the pc? is there signs of life on your controller when plugged into your ps4 or pc ( lights up, chimes, inputs) ?
if your contoller isnt recognized or no signs of life on your pc or ps4, look at the usb charging port first, then if no fault is found, look into the battery. depending on which controller you have, here are links to help with the teardown and trouble shooting for the charging port/ battery:
DualShock 4 CUH-ZCT1
DualShock 4 CUH-ZCT2
to test your battery, use this guide here :
Technique - Test the Battery